Encodes a buffer into a Z85 string.
The buffer length must be a multiple of 4.
@eryx/encoding/base85 ModuleZ85 (ZeroMQ Base85) encoding utilities.
Encodes and decodes binary buffer data using the Z85 alphabet,
a compact base-85 representation designed for use in source code
and XML. Input length must be a multiple of 4 bytes.
local base85 = require("@eryx/encoding/base85")
local data = buffer.fromstring("\x86\x4f\xd2\x6f")
print(base85.encode(data)) -- "HelloWorld" (example)
Caution
Z85 requires the input buffer length to be a multiple of 4 bytes for encoding and the string length to be a multiple of 5 characters for decoding. Inputs that don’t meet this constraint will raise an error.
Encodes a buffer into a Z85 string.
The buffer length must be a multiple of 4.
The binary data to encode.
The Z85-encoded string.
Decodes a Z85 string back into a buffer.
The string length must be a multiple of 5.
The Z85-encoded string.
The decoded binary data.