Simple hamming encoder algorithm verify