splitBitPrefixInto
splitBitPrefixInto(
prefix,subnetCount):BitPrefix[]
Defined in: packages/net-address/src/prefix/aggregate.ts:99
Divides a prefix into at least subnetCount equal subnets.
Subnets only come in powers of two, so asking for 3 gives 4. The extra blocks are returned rather than dropped: a caller splitting for allocation needs to know they exist.
Parameters
Section titled “Parameters”prefix
Section titled “prefix”subnetCount
Section titled “subnetCount”number
Returns
Section titled “Returns”Throws
Section titled “Throws”RangeError When subnetCount is not a positive integer, or when the
prefix cannot be divided that far.