complete document MaxMind DB File Format SpecificationDescription
here is only how convert trie tree to array
1 | 0100, 1011 -> trie |
trie -> array
left is 0, right is 1
value is index of array
1 | left | right byte/index |
for example:
index 1:
next left index 2 is null, so 00* is not exist
next right index 2+1 = 3 is not null, continue search until end or null
this is one byte as one child, but one byte max is 255, if node more than 255, we can use multiple byte as one child