Pdf - Static Functions

30 Sep 20263 minutes to read

Root static functions of Pdf Component

_createAsn1Constructed

Creates a der encoded asn1 constructed element.

Parameter Type Description
tag number The asn1 constructed tag.
elements _PdfUniqueEncodingElement[] The ordered child elements to be nested.

Returns _PdfUniqueEncodingElement

_createPrimitive

Creates a der encoded asn1 primitive element.

Parameter Type Description
tag number The asn1 tag.
value Uint8Array Encoded primitive value bytes.

Returns _PdfUniqueEncodingElement

_encodeCodePointToUtf8

Encodes a single Unicode code point (U+0000 to U+10FFFF) into UTF-8 bytes.

Parameter Type Description
codePoint number The Unicode code point to encode.

Returns number[]

_encodeObjectIdentifier

Encodes a dotted Object Identifier string into der bytes.

Parameter Type Description
oidString string The dotted oid string.

Returns Uint8Array

_hashBytes

Compute a 32-bit non-cryptographic hash of a byte array.

Parameter Type Description
bytes Uint8Array The input bytes to hash.

Returns number

_isByteArrayEqual

Compare two byte arrays for exact equality.

Parameter Type Description
a (optional) Uint8Array First byte array.
b (optional) Uint8Array Second byte array.

Returns boolean

_isHexDigit

Checks whether a given character is a valid hexadecimal digit.

Parameter Type Description
ch string The character to check.

Returns boolean

_toHex2

Converts a number to a two-character uppercase hexadecimal string.

Parameter Type Description
n number The number to convert (0 to 255 recommended).

Returns string

_trimInteger

Trim leading zero bytes from a big-endian integer byte array.

Parameter Type Description
bytes Uint8Array The integer represented as a byte array.

Returns Uint8Array