Hamming code implementation