IPV4_MASKS variable

The 33 IPv4 network masks, indexed by prefix length — IPV4_MASKS[24] is the mask for a /24.

Signature:

IPV4_MASKS: bigint[]

Remarks

Precomputed rather than shifted per call, because a conversion does this on every record in a list. Index 0 is 0n (a /0, matching everything) and index 32 is all ones (a single host), so the array is 33 entries and indexing it with a prefix length needs no adjustment.

Exported as a plain array, so it is mutable — treat it as read-only. Reach for masksOf() instead when the family is only known at run time.

Read this page as plain markdown — no HTML, no navigation. For pasting into an LLM, or for an agent to fetch.