Skip to content

BitAddress

BitAddress = object

Defined in: packages/net-address/src/prefix/bit-address.ts:29

A fixed-width bit string — the one representation IPv4, IPv6 and EUI-48/EUI-64 all share.

bitWidth is carried, never derived. Every constructor takes a width the value itself cannot supply: 0x7f000001n is a 32-bit IPv4 address and also a 128-bit IPv6 address, and a width read back from a value’s significant bits would call it 31.

value is unsigned, because an address has no sign bit: 255.255.255.255 is 4294967295n, never -1n.

readonly bitWidth: number

Defined in: packages/net-address/src/prefix/bit-address.ts:34

A positive multiple of 8.


readonly value: bigint

Defined in: packages/net-address/src/prefix/bit-address.ts:31

Unsigned, and no wider than bitWidth bits.