Skip to content

bitAddressFromBytes

bitAddressFromBytes(bytes, bitWidth): BitAddress

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

Builds an address from octets, most significant first.

One of the two wire-form boundaries, with bitAddressToBytes. Every operation in between works on the value, so a parser converts once on the way in rather than per octet.

Uint8Array

The octets, most significant first.

number

The width in bits; must be bytes.length * 8.

BitAddress

RangeError When bitWidth is not a positive multiple of 8, or does not match bytes.length.