📦 Archived documentation: r1 (committed 2026-07-24) View current documentation →

bin.toHex()

bin.toHex(data) → string

Converts binary data to a printable hex string.

The inverse is bin.fromHex().

Arguments

NameTypeRequiredDefaultDescription
data buffer | string yes Binary data, e.g. a sha256() digest or packed array.

Returns

string Hexadecimal representation.

Example

let aesKey = sha256("flexscadaFlexsQ5!");
print("KEY: ", bin.toHex(aesKey));