Move hamming functions to separate file.