0

I paid good money for this internet, I should not need to type in all those bits.

Seriously folks, we are talking about a total of 128 bits altogether. Do you really expect me to type those all in myself?

bigjosh
  • 1,273
  • 13
  • 19

1 Answers1

0

Here is the table of hamming(8,4) values for your copy/pasting pleasure...

uint8_t hamming84table[16] = {
    0b00000000,
    0b11010010,
    0b01010101,
    0b10000111,
    0b10011001,
    0b01001011,
    0b11001100,
    0b00011110,
    0b11100001,
    0b00110011,
    0b10110100,
    0b01100110,
    0b01111000,
    0b10101010,
    0b00101101,
    0b11111111
};

This code should work in C, C++, Java and most others of that ilk.

You can change the unint_8 to match the unsigned byte type on your platform of choice.

Your welcome.

(BTW, if you don't know what this is - if you need to send a value between 0-15 across a noisy transmission channel then you can send the corresponding 8-bit pattern above. Then on the receiving side, if you get one of the above patterns, you can look up which value was sent and be as sure as you can be with this much data that you got the right value. If you don't get one of the above values, then at least you know it got messed up in transit, and you can even potentially recover what value was likely sent from the messed value. So cool.)

bigjosh
  • 1,273
  • 13
  • 19