Example, sequence to encode : Super !
S : 18, LOW : 27, u : 20, p : 15, e : 4, r : 17, SPACE : 26, T_PUN : 29, ! : 10
that is 9 characters, we'll add a T_PUN for the padding.
CW1 = 18 x 30 + 27 = 567
CW2 = 20 x 30 + 15 = 615
CW3 = 4 x 30 + 17 = 137
CW4 = 26 * 30 + 29 = 809
CW5 = 10 x 30 + 29 = 329
The sequence is consequently : 567, 615, 137, 809, 329
Example 1 : word to encode : alcool
The sequence of bytes (In ASCII) is donc : 97, 108, 99, 111, 111, 108
S = 97 x 2565 + 108 x 2564 + 99 x 2563 + 111 x 2562 + 111 x 256 + 108 = 107 118 152 609 644
CW0 = 107 118 152 609 644 MOD 900 = 244
S = 107 118 152 609 644 \ 900 = 119 020 169 566
CW1 = 119 020 169 566 MOD 900 = 766
S = 119 020 169 566 \ 900 = 132 244 632
CW2 = 132 244 632 MOD 900 = 432
S = 132 244 632 \ 900 = 146 938
CW3 = 146 938 MOD 900 = 238
S = 146 938 \ 900 = 163
CW4 = 163 MOD 900 = 163
The sequence including the switch is consequently : 924, 163, 238, 432, 766, 244
Example 2 : word to encode : alcoolique
The sequence of bytes (in ASCII) is : 97, 108, 99, 111, 111, 108, 105, 113, 117, 101
The first 6 bytes are coded like above and we add 105, 113, 117 et 101
The sequence including the switch is consequently : 901, 163, 238, 432, 766, 244, 105, 113, 117, 101
Example, sequence to encode : 01234
There will be thus 5 \ 3 + 1 = 2 MC
Add a "1" ahead : 101234
CW0 = 101 234 MOD 900 = 434
S = 101 234 \ 900 = 112
CW1 = 112 MOD 900 = 112
The sequence is consequently : 112, 434