A implementation of Hamming