Skip to content

derBitString ​

derBitString ​

Encodes a DER BIT STRING (tag 0x03).

The value is prefixed with a single octet indicating how many trailing bits in the last byte are unused.

ts
function derBitString(
	value: Uint8Array,
	unusedBits: number,
): Uint8Array

Parameters

  • value: Uint8Array
  • unusedBits: number — Number of unused trailing bits (0–7). Defaults to 0.

Released under the MIT License.