ZMQ_Z85_ENCODE(3)
β¨ NAME β¨
okay so bestie, welcome to the zmq_z85_encode page π this is the one from the 0MQ Manual, and it does exactly one iconic thing: it takes a binary key and turns it into Z85 printable text. slay.
πΈ SYNOPSIS πΈ
char *zmq_z85_encode (char *dest, const uint8_t *data, size_t size);
π DESCRIPTION π
so what does zmq_z85_encode() actually do?? it shall encode the binary block you hand it β that's the one specified by data and size β into a string, and it drops that string into dest. main character behaviour, honestly.
two things you literally cannot skip, no cap:
- the size of the binary block must be divisible by 4. that's not a suggestion, that's the vibe check π¨
destmust have sufficient space forsize * 1.25plus 1 for a null terminator.
and for the math girlies: a 32-byte CURVE key gets encoded as 40 ASCII characters plus a null terminator. that's the glow-up π¦
the encoding shall follow the ZMQ RFC 32 specification. periodt.
π₯ RETURN VALUE π₯
zmq_z85_encode() shall return dest if it's successful β¨ else it shall return NULL. it's giving "either thriving or nothing at all" π
π EXAMPLE π
encoding a CURVE key, bestie:
#include <sodium.h>
uint8_t public_key [32];
uint8_t secret_key [32];
int rc = crypto_box_keypair (public_key, secret_key);
assert (rc == 0);
char encoded [41];
zmq_z85_encode (encoded, public_key, 32);
puts (encoded);
note the char encoded [41] β 40 characters plus room for the null terminator, exactly like we said π she's prepared.
π SEE ALSO π
go read those too, iykyk π
π AUTHORS π
this page was written by the 0MQ community. if you wanna make a change, please read the 0MQ Contribution Policy at http://www.zeromq.org/docs:contributing. community effort fr fr, we love to see it π«Ά
okay and that's the whole page, bestie!! this was the 0MQ 4.3.5 version, dated 10/09/2023, from the ZMQ_Z85_ENCODE(3) page itself π go forth and encode responsibly, mwah ππ
π¦ where this page comes from
- epel 10: zeromq 4.3.5-18.el10_0 Β· MPL-2.0 AND BSD-3-Clause AND MIT
- fedora 43: zeromq 4.3.5-22.fc43 Β· MPL-2.0 AND BSD-3-Clause AND MIT
- fedora 43: zeromq 4.3.5-22.fc43 Β· MPL-2.0 AND BSD-3-Clause AND MIT
- fedora 44: zeromq 4.3.5-22.fc43 Β· MPL-2.0 AND BSD-3-Clause AND MIT
- fedora 44: zeromq 4.3.5-22.fc43 Β· MPL-2.0 AND BSD-3-Clause AND MIT
- opensuse-leap 16.0: zeromq-devel 4.3.5-160000.2.2 Β· MPL-2.0
- opensuse-leap 16.0: zeromq-devel 4.3.5-160000.2.2 Β· MPL-2.0
- opensuse-leap 16.0: zeromq-devel 4.3.5-160000.2.2 Β· MPL-2.0
- opensuse-leap 16.0: zeromq-devel 4.3.5-160000.2.2 Β· MPL-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms