Utils

Utils

Contains misc static utility methods.

Constructor

new Utils()

Source:

Methods

(static) atob(string) → {string}

Decodes base-64 encoded string
Source:
Parameters:
Name Type Description
string string
Returns:
Type:
string

(static) bytesToHex(byteArray) → {string}

Converts an array of bytes to a hex string.
Source:
Parameters:
Name Type Description
byteArray array
Returns:
Type:
string

(static) bytesToLetters(byteArray) → {string}

Converts an array of bytes to letters.
Source:
Parameters:
Name Type Description
byteArray array
Returns:
Type:
string

(static) bytesToNumber(byteArray) → {number}

Converts an array of bytes to a number.
Source:
Parameters:
Name Type Description
byteArray array
Returns:
Type:
number

(static) byteToHex(byte) → {string}

Converts a single byte to a hex string.
Source:
Parameters:
Name Type Description
byte number
Returns:
Type:
string

(static) decToBinary(dec) → {string}

Converts a decimal to it's binary representation.
Source:
Parameters:
Name Type Description
dec number
Returns:
Type:
string

(static) getVarIntLength(byteArray) → {number}

Determines the length in bytes of a variable length quaantity. The first byte in given range is assumed to be beginning of var length quantity.
Source:
Parameters:
Name Type Description
byteArray array
Returns:
Type:
number

(static) hexToNumber(hexString) → {number}

Converts a hex string to a number.
Source:
Parameters:
Name Type Description
hexString string
Returns:
Type:
number

(static) readVarInt(byteArray) → {number}

Reads a variable length value.
Source:
Parameters:
Name Type Description
byteArray array
Returns:
Type:
number