hamming code work even if the two string have'nt the same length, most of your code are false, sorry...
(sorry for my language, i'm french...)