0xF83B5323 has the following binary representation: 1111 1000 0011 1011 0101 0011 0010 0011. The string 00010 is not a substring if you read from left to right, and if you read from right to left then 01000 is not a substring. Conversely the substring 11111 is not unique.
0xF83B5323 is a magic number:
| MSB position | (v*0xF83B5323)>>27 |
|---|---|
| 0 | 11111 |
| 1 | 11101 |
| 2 | 11001 |
| 3 | 10001 |
| 4 | 00001 |
| 5 | 00010 |
| 6 | 00100 |
| 7 | 01000 |
| 8 | 01111 |
| 9 | 11110 |
| 10 | 11100 |
| 11 | 10111 |
| 12 | 01110 |
| 13 | 11011 |
| 14 | 10110 |
| 15 | 01011 |
| 16 | 10101 |
| 17 | 01010 |
| 18 | 10100 |
| 19 | 00111 |
| 20 | 01101 |
| 21 | 11010 |
| 22 | 10011 |
| 23 | 00101 |
| 24 | 01001 |
| 25 | 10010 |
| 26 | 00011 |
| 27 | 00110 |
| 28 | 01100 |
| 29 | 11000 |
| 30 | 10000 |
| 31 | 00000 |
The binary expansion of 0x06EB14F9 is 0000 0110 1110 1011 0001 0100 1111 1001
| MSB position | (v*0x06EB14F9)>>27 |
|---|---|
| 0 | 00000 |
| 1 | 00001 |
| 2 | 00010 |
| 3 | 00110 |
| 4 | 01000 |
| 5 | 10110 |
| 6 | 10010 |
| 7 | 01001 |
| 8 | 11000 |
| 9 | 10101 |
| 10 | 10000 |
| 11 | 00110 |
11 gets assigned the same bit string as 3.
Copyright Alfredo Cruz-Carlon, 2025