Hamming in C#