Skip to content

Commit 23f1def

Browse files
oschwaldclaude
andcommitted
Clarify record size range in spec
Replace the misleading "24 to 128 bits" range with precise constraints: record size must be a multiple of 4, at least 24 bits. Note that all existing databases use 24, 28, or 32 bits while the format supports larger sizes. Drop the redundant "(24, 28, or 32)" parenthetical from the Search Lookup Algorithm section. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 6030b94 commit 23f1def

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

MaxMind-DB-spec.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -158,12 +158,12 @@ relevant to the given netblock.
158158

159159
Each node in the search tree consists of two records, each of which is a
160160
pointer. The record size varies by database, but inside a single database node
161-
records are always the same size. A record may be anywhere from 24 to 128 bits
162-
long, depending on the number of nodes in the tree. These pointers are
163-
stored in big-endian format (most significant byte first).
161+
records are always the same size. The record size must be a multiple of 4 and
162+
is at least 24 bits. All existing databases use record sizes of 24, 28, or 32
163+
bits, but the format supports larger sizes following the same pattern. These
164+
pointers are stored in big-endian format (most significant byte first).
164165

165-
Here are some examples of how the records are laid out in a node for 24, 28,
166-
and 32 bit records. Larger record sizes follow this same pattern.
166+
Here are the record layouts for 24, 28, and 32 bit records.
167167

168168
#### 24 bits (small database), one node is 6 bytes
169169

@@ -194,8 +194,7 @@ bit, a value of 0 means we choose the left record in a node, and a value of 1
194194
means we choose the right record.
195195

196196
The record value is always interpreted as an unsigned integer. The maximum
197-
size of the integer is dependent on the number of bits in a record (24, 28, or
198-
32).
197+
size of the integer is dependent on the number of bits in a record.
199198

200199
If the record value is a number that is less than the *number of nodes* (not
201200
in bytes, but the actual node count) in the search tree (this is stored in the

0 commit comments

Comments
 (0)