Moved chunked hamming calculation to cryptolib so it can be mmore easily used in other scripts.