class Utilities (View source)

Helper Utilities

Methods

static string
hash256(string $data, bool $raw = false)

Run sha256 hash on $data twice

static string
sha256(string $data, bool $raw = false)

Run sha256 hash on $data

static int|float|string
swapEndian(string $hex, bool $hexdec = true)

Swap endianness of an hexadecimal string.

Details

static string hash256(string $data, bool $raw = false)

Run sha256 hash on $data twice

Parameters

string $data
bool $raw

If true return the raw binary data.

Return Value

string

static string sha256(string $data, bool $raw = false)

Run sha256 hash on $data

Parameters

string $data
bool $raw

If true return the raw binary data.

Return Value

string

static int|float|string swapEndian(string $hex, bool $hexdec = true)

Swap endianness of an hexadecimal string.

Parameters

string $hex
bool $hexdec

[Default true] convert from hex to decimal.

Return Value

int|float|string