Encoding and Crypto

Hashing, encryption, Base64, binary encoding and character sets.

Hashing, encryption, Base64, binary encoding and character sets. 18 entries. This page is generated from the MatchBox source; see the function reference index for how to read the tables and what each gate means.

FunctionFormsGateNotes
binaryDecodebinaryDecode( ... )alwaysDecodes text such as hex into binary data.
binaryEncodebinaryEncode( ... )alwaysEncodes binary data as text, for example "hex".
bytesGetbytesGet( ... )always
bytesLenbytesLen( ... )always
bytesNewbytesNew( ... )always
bytesSetbytesSet( ... )always
charsetDecodecharsetDecode( ... ), string.charsetDecode( ... )always
charsetEncodecharsetEncode( ... )always
decryptdecrypt( ... )bif-cryptoDecrypts a value produced by encrypt.
encryptencrypt( ... )bif-cryptoEncrypts a string: encrypt( value, key, algorithm, encoding ).
generatePBKDFKeygeneratePBKDFKey( ... )bif-crypto
generateSecretKeygenerateSecretKey( ... )bif-cryptoGenerates a key for the given algorithm, for example "AES".
hashhash( ... ), string.hash( ... )bif-cryptoReturns the hash as hex text; MD5 unless an algorithm is given.
hash40hash40( ... )bif-cryptoReturns the SHA-1 hash of a string as hex.
hmachmac( ... ), string.hmac( ... )bif-cryptoReturns the HMAC of a message: hmac( message, key, algorithm ).
toBase64toBase64( ... )alwaysEncodes a string or binary as Base64.
toBinarytoBinary( ... )alwaysDecodes a Base64 string to binary.
urlEncodedFormaturlEncodedFormat( ... ), string.urlEncodedFormat( ... )alwaysPercent-encodes a string for use in a URL.
Edit this page Download Markdown Last updated Oct 27, 2026, 1:45:34 PM Report an issue