Functions

base64_decode(data)

Array

Evaluates to given data decoded via Base64 encoding

Parameters
  • data: String

    Data to decode

Returns
  • Array

base64_encode(data)

String

Evaluates to given data encoded via Base64 encoding

Parameters
  • data: String|Array

    String or array of numbers to encode

Returns
  • String

bytes2hex(data, toUpperCase)

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
  • String

bytes2str(data, encoding)

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
  • String

hex2bytes(data)

Array

Creates an array of numbers from parsing a hex string

Parameters
  • data: String

    Hex string like "cafec0de"

Returns
  • Array

md5(data)

String

Calculates MD5 hash of specified data

Parameters
  • data: String|Array

    String or array of numbers to calculate hash from

Returns
  • String

sha1(data)

String

Calculates SHA-1 hash of specified data

Parameters
  • data: String

    String to calculate hash from

Returns
  • String

sha256(data)

String

Calculates SHA-256 hash of specified data

Parameters
  • data: String

    String to calculate hash from

Returns
  • String

str2bytes(data, encoding)

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
  • Array

uuidgen()

String

Generates unique identifier and returns it's string representation

Returns
  • String