API Reference

Crypt

Encoding, hashing, compression, and symmetric encryption.

Available Functions

FunctionDescription
crypt.base64decodeReturns a base64 decoded string.
crypt.base64encodeReturns a base64 encoded string.
crypt.decryptDecrypts provided data using AES encryption. Returns the decrypted data.
crypt.encryptEncrypts provided data using AES encryption. Returns both the encrypted data and the initialization vector (iv).
crypt.generatebytesReturns a string of randomly generated bytes. The result is base64 encoded.
crypt.generatekeyGenerates and returns a random key. Frequently used in combination with with crypt.encrypt and crypt.decrypt.
crypt.hashHashes and returns user provided data using the specified hashing algorithm.
crypt.hmacGenerates and returns an HMAC (Hash based Message Authentication Code). Frequently used in message authentication (see example below).
crypt.lz4compressReturns a compressed string using the LZ4 algorithm.
crypt.lz4decompressReturns a decompressed string using the LZ4 algorithm.
crypt.randomReturns a string of randomly generated bytes. The result is not base64 encoded.