Skip to content

aggregateBitPrefixes

aggregateBitPrefixes(prefixes): BitPrefix[]

Defined in: packages/net-address/src/prefix/aggregate.ts:27

Summarises a collection into the shortest equivalent prefix list: overlaps absorbed, adjacent siblings merged, everything sorted.

10.0.0.0/25 and 10.0.0.128/25 come back as 10.0.0.0/24. O(n log n) in the number of prefixes, plus at most 2 * bitWidth prefixes per resulting run.

Iterable<BitPrefix>

BitPrefix[]

RangeError When the prefixes are not all the same width.