hamming encoding and decoding