Code compression and decompression applied using concepts of bit masking and hamming distance