3.1.8.4.1.2.2 Length-of-Match Encoding
Encoding of the length-of-match (L-o-M) value is performed according to the following table.
L-o-M range |
Encoding (binary header + L-o-M bits) |
---|---|
3 |
0 |
4...7 |
10 + 2 lower bits of L-o-M |
8...15 |
110 + 3 lower bits of L-o-M |
16...31 |
1110 + 4 lower bits of L-o-M |
32...63 |
11110 + 5 lower bits of L-o-M |
64...127 |
111110 + 6 lower bits of L-o-M |
128...255 |
1111110 + 7 lower bits of L-o-M |
256...511 |
11111110 + 8 lower bits of L-o-M |
512...1023 |
111111110 + 9 lower bits of L-o-M |
1024...2047 |
1111111110 + 10 lower bits of L-o-M |
2048...4095 |
11111111110 + 11 lower bits of L-o-M |
4096...8191 |
111111111110 + 12 lower bits of L-o-M |
For example:
A length-of-match value of 15 is encoded as the binary value 110 111.
A length-of-match value of 120 is encoded as the binary value 111110 111000.
A length-of-match value of 4097 is encoded as the binary value 111111111110 000000000001.