Encodings
Z85
ZeroMQ base85 with an alphabet safe to paste into source code. Whole four byte groups only
Encoding / Base85
Z85
Base85 safe to paste into source code.
- Overhead
- +25% on random bytes
- Padding
- none
- Standard
- ZeroMQ RFC 32/Z85
- Used by
- ZeroMQ
family 2 / 20
Sample
- Out
- xK#0@zY<mxA+]nf
- Back
- "hello world!"
0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ.-:+=^!/*?&<>()[]{}@%$#
Access
- Import
import { z85 } from "@agntn/encodings/base85" - CLI
encodings encode z85 'hello world!' - Tryplayground with the sample above
- Kinascii85
ZeroMQ wanted base85 you can drop into a C string or a JSON value without escaping. So no ", no ', no backslash. XML is another story, < and & are both in there.
z85.encode(hex.decode("864FD26FB559F75B")); // "HelloWorld"
That's the example from ZeroMQ RFC 32. Did they pick the bytes to spell it? Of course they did. Z85 only does whole groups. Encode two bytes and you get an error, not padding. Pad it yourself if you have to.