SIGN UP
Navigation

Global

Methods

base64_decode(data: String): Array

Evaluates to given data decoded via Base64 encoding

Parameters

  • data:

    String

    Data to decode

Returns

  • Return:

    Array
base64_encode(data: String|Array): String

Evaluates to given data encoded via Base64 encoding

Parameters

  • data:

    String|Array

    String or array of numbers to encode

Returns

  • Return:

    String
bytes2hex(data: Array, toUpperCase: Boolean): String

Creates a hex string from given bytes array.

Parameters

  • data:

    Array

    Array of numbers to convert into a string

  • toUpperCase:

    Boolean

    If set to 'true', resulting string will have uppercase 'A-F' chars. Default is 'false'.

Returns

  • Return:

    String
bytes2str(data: Array, encoding: String): String

Given array of numbers create a string from them using specified encoding

Parameters

  • data:

    Array

    Array of numbers to create a string from

  • encoding:

    String

    Encoding to use for string creation, "utf-8" by default.

Returns

  • Return:

    String
hex2bytes(data: String): Array

Creates an array of numbers from parsing a hex string

Parameters

  • data:

    String

    Hex string like "cafec0de"

Returns

  • Return:

    Array
md5(data: String|Array): String

Calculates MD5 hash of specified data. Can be used with HTTP requests that require hash.

Parameters

  • data:

    String|Array

    String or array of numbers to calculate hash from

Returns

  • Return:

    String
sha1(data: String): String

Calculates SHA-1 hash of specified data. Can be used with HTTP requests that require hash.

Parameters

  • data:

    String

    String to calculate hash from

Returns

  • Return:

    String
sha256(data: String): String

Calculates SHA-256 hash of specified data

Parameters

  • data:

    String

    String to calculate hash from

Returns

  • Return:

    String
str2bytes(data: String, encoding: String): Array

Creates an array of numbers from parsing string in specified codepage

Parameters

  • data:

    String

    String to parse

  • encoding:

    String

    String encoding, "utf-8" by default.

Returns

  • Return:

    Array
uuidgen(): String

Generates unique identifier and returns it's string representation

Returns

  • Return:

    String