hamming in js