javascript hamming