ZDIGEST(3)
β¨ ZDIGEST β¨
okay bestie, sit down, hydrate, and let me tell you about zdigest π β it's the hashing class from the CZMQ Manual, and it's genuinely so good at what it does.
πΈ NAME πΈ
zdigest β a class that provides hashing functions (SHA-1 at present). no cap, that's the whole job π
π SYNOPSIS π
// This is a stable class, and may not change except for emergencies. It
// is provided in stable builds.
// Constructor - creates new digest object, which you use to build up a
// digest by repeatedly calling zdigest_update() on chunks of data.
CZMQ_EXPORT zdigest_t *
zdigest_new (void);
// Destroy a digest object
CZMQ_EXPORT void
zdigest_destroy (zdigest_t **self_p);
// Add buffer into digest calculation
CZMQ_EXPORT void
zdigest_update (zdigest_t *self, const byte *buffer, size_t length);
// Return final digest hash data. If built without crypto support,
// returns NULL.
CZMQ_EXPORT const byte *
zdigest_data (zdigest_t *self);
// Return final digest hash size
CZMQ_EXPORT size_t
zdigest_size (zdigest_t *self);
// Return digest as printable hex string; caller should not modify nor
// free this string. After calling this, you may not use zdigest_update()
// on the same digest. If built without crypto support, returns NULL.
CZMQ_EXPORT char *
zdigest_string (zdigest_t *self);
// Self test of this class.
CZMQ_EXPORT void
zdigest_test (bool verbose);
π«Ά heads up: the source file is asking for a favor β Please add'@interface'section in'./../src/zdigest.c'. so like, if that's your thing, go off.
π¦ DESCRIPTION π¦
okay so the zdigest class generates a hash from zchunks of data. the current algorithm is SHA-1, and the reason is literally just speed β‘ β the goal is generating a unique digest for a file, and there are no security issues in this use case. so it's giving "fast and unbothered," not "cryptographically dramatic."
the current code depends on OpenSSL, which might be replaced by a hard coded SHA-1 implementation to reduce build dependencies. so watch that space, bestie π
π EXAMPLE π
this one's straight from the zdigest_test method, so you know it works:
byte *buffer = (byte *) zmalloc (1024);
memset (buffer, 0xAA, 1024);
zdigest_t *digest = zdigest_new ();
assert (digest);
zdigest_update (digest, buffer, 1024);
const byte *data = zdigest_data (digest);
assert (data [0] == 0xDE);
assert (data [1] == 0xB2);
assert (data [2] == 0x38);
assert (data [3] == 0x07);
assert (streq (zdigest_string (digest),
"DEB23807D4FE025E900FE9A9C7D8410C3DDE9671"));
zdigest_destroy (&digest);
freen (buffer);
#if defined (__WINDOWS__)
zsys_shutdown();
#endif
like look at that hex string. DEB23807D4FE025E900FE9A9C7D8410C3DDE9671. iconic behavior fr fr π
π AUTHORS π
the czmq manual was written by the authors in the AUTHORS file. (yes, those authors. the ones in the file. love that for them.)
β RESOURCES β
- main web site: (yes bestie, it's listed, and it is blank. we move.)
- report bugs to the email <zeromq-dev@lists.zeromq.org[1]>
π COPYRIGHT π
Copyright (c) the Contributors as noted in the AUTHORS file. this file is part of CZMQ, the high-level C binding for 0MQ: http://czmq.zeromq.org. this Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. if a copy of the MPL was not distributed with this file, you can obtain one at http://mozilla.org/MPL/2.0/. LICENSE included with the czmq distribution.
π NOTES π
zeromq-dev@lists.zeromq.orgmailto:zeromq-dev@lists.zeromq.org
and that's the whole page, bestie π this was CZMQ 4.2.1, dated 01/16/2026 β so go forth, hash responsibly, and remember: it's giving SHA-1, not it's giving secure. mwah πβ¨
π¦ where this page comes from
- fedora 44: czmq-devel 4.2.1-24.fc44 Β· MPL-2.0
- fedora 44: czmq-devel 4.2.1-24.fc44 Β· MPL-2.0
- ubuntu resolute: libczmq-dev 4.2.1-3build1 Β· MPL-2.0
- ubuntu stonking: libczmq-dev 4.2.1-3build1 Β· MPL-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms