Skip to content

derInteger ​

derInteger ​

Encodes raw big-endian bytes as a DER INTEGER (tag 0x02).

Strips leading zero bytes for minimal encoding and prepends a zero byte when the high bit is set to keep the value non-negative.

ts
function derInteger(
	bytes: Uint8Array,
): Uint8Array

Parameters

  • bytes: Uint8Array

Released under the MIT License.