toIntArray() function

Unpacks a binary list back into integer address ranges.

Signature:

export declare function toIntArray(list: Buffer, type: NetworkType): [bigint, bigint][];

Parameters

Parameter

Type

Description

list

Buffer

a buffer produced by toBinaryList()

type

NetworkType

which family the buffer holds; the bytes do not say

Returns:

[bigint, bigint][]

One [start, end] tuple per record, in stored order — which is ascending, since toBinaryList() sorted them.

Remarks

Reads fixed-width records, so type must match what was written: unpacking an IPv4 buffer as IPv6 does not fail, it silently reinterprets four 4-byte addresses as one 16-byte pair. A trailing partial record is read as though the missing bytes were zero rather than rejected.

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