Encoding
The Encoding library provides functions for common binary transformation operations such as Base64 and LZ4 - the encoding, decoding, compression, and decompression of data.
This library replaces the old crypt
library, which has now been fully deprecated.
Where is the crypt
library?
sUNC has not tested the crypt
library in a very long time now. In fact, the last remaining functions that we did test, Base64, did not deserve to be in the crypt
category.
This is due to multiple reasons, but mainly because having cryptography functions available in an executor's environment is not safe because other scripts can easily redefine them to hijack potentially sensitive information. For anyone who requires cryptography, we advise you to just inline/"bring your own" cryptography functions in your code and use it from there.
What can you do?
With the Encoding library, you can:
- Encode and decode binary or text data into Base64 using
base64encode
andbase64decode
- Compress and decompress data efficiently using the LZ4 algorithm with
lz4compress
andlz4decompress
What are Base64 and LZ4?
Base64 is a binary-to-text encoding scheme that represents binary data using ASCII characters, making it suitable for embedding in text-based formats such as JSON or XML.
LZ4 is a lossless data compression algorithm known for its high speed and low latency.
What can't you do?
- These functions are designed for data transformation only and are not encryption methods designed to replace any previous
crypt
functions. They do not provide confidentiality or security.