Alphanumeric Mode Encoding

For alphanumeric mode encoding, I will use the example input of HELLO WORLD. For this example, I will use version 1. Remember, alphanumeric mode can only encode uppercase letters, not lowercase. Refer to the alphanumeric table for a list of the characters that can be encoded in alphanumeric mode.

Break up into pairs

First, break up the string into pairs of characters: HE, LL, O , WO, RL, D

Create a binary number for each pair

For alphanumeric mode, each alphanumeric character is represented by a number. Please refer to the alphanumeric table to find these numbers. The column on the left shows the alphanumeric character, and the column on the right shows the number that represents it.

For each pair of characters, get the number representation (from the alphanumeric table) of the first character and multiply it by 45. Then add that number to the number representation of the second character.

For example, the first pair in HELLO WORLD is HE.

H → 17
E → 14

Following the steps in the previous paragraph, multiply the first number by 45, then add that to the second number:

(45 * 17) + 14 = 779

Now convert that number into an 11-bit binary string, padding on the left with 0s if necessary.

779 → 01100001011

If you are encoding an odd number of characters, as we are here, take the numeric representation of the final character and convert it into a 6-bit binary string.

Next: Finish the Data Encoding Step

Follow the instructions on the data encoding page to add any remaining bits as necessary.