Class: DataUtils

DataUtils

new DataUtils()

A DataUtils has static methods for converting data.
Source:

Methods

(static) arraysEqual()

Return true if a1 and a2 are the same length with equal elements.
Source:

(static) base64toString()

Base 64 to Raw String
Source:

(static) bigEndianToUnsignedInt()

Convert the big endian Buffer to an unsigned int. Don't check for overflow.
Source:

(static) concatArrays()

arrays is an array of Buffer. Return a new Buffer which is the concatenation of all.
Source:

(static) hexToRawString()

Hex String to raw string.
Source:

(static) nonNegativeIntToBigEndian()

Convert the int value to a new big endian Buffer and return. If value is 0 or negative, return new Buffer(0).
Source:

(static) privateKeyPemToDer(The) → {Buffer}

Decode the base64-encoded private key PEM and return the binary DER.
Parameters:
Name Type Description
The string PEM-encoded private key.
Source:
Returns:
The binary DER.
Type
Buffer

(static) shuffle()

Modify array to randomly shuffle the elements.
Source:

(static) stringtoBase64()

Raw String to Base 64
Source:

(static) stringToHex()

Raw string to hex string.
Source:

(static) stringToUtf8Array()

Encode str as utf8 and return as Buffer.
Source:

(static) toHex()

Buffer to Hex String
Source:

(static) toNumbers()

Hex String to Buffer.
Source:

(static) toNumbersFromString()

Raw String to Buffer.
Source:

(static) toNumbersIfString(value) → {Buffer}

If value is a string, then interpret it as a raw string and convert to a Buffer. Otherwise assume it is a Buffer or array type and just return it.
Parameters:
Name Type Description
value string | any
Source:
Returns:
Type
Buffer

(static) toString()

Buffer to raw string.
Source: