Hamming and Prity Encoding