ZUUID(3)
π ZUUID π
okay so bestie, welcome to ZUUID(3) from the CZMQ Manual β it's giving "I make UUIDs and I do it fabulously" and honestly? obsessed. π
β¨ NAME β¨
zuuid β the class for UUID support, aka the girl who generates universally unique identifiers and then helps you do stuff with them. π¦
β¨ SYNOPSIS β¨
heads up bestie: this is a stable class, and it may not change except for emergencies. It is provided in stable builds. periodt. π
CZMQ_EXPORT zuuid_t *
zuuid_new (void);
CZMQ_EXPORT zuuid_t *
zuuid_new_from (const byte *source);
CZMQ_EXPORT void
zuuid_destroy (zuuid_t **self_p);
CZMQ_EXPORT void
zuuid_set (zuuid_t *self, const byte *source);
CZMQ_EXPORT int
zuuid_set_str (zuuid_t *self, const char *source);
CZMQ_EXPORT const byte *
zuuid_data (zuuid_t *self);
CZMQ_EXPORT size_t
zuuid_size (zuuid_t *self);
CZMQ_EXPORT const char *
zuuid_str (zuuid_t *self);
CZMQ_EXPORT const char *
zuuid_str_canonical (zuuid_t *self);
CZMQ_EXPORT void
zuuid_export (zuuid_t *self, byte *target);
CZMQ_EXPORT bool
zuuid_eq (zuuid_t *self, const byte *compare);
CZMQ_EXPORT bool
zuuid_neq (zuuid_t *self, const byte *compare);
CZMQ_EXPORT zuuid_t *
zuuid_dup (zuuid_t *self);
CZMQ_EXPORT void
zuuid_test (bool verbose);
and here's the rundown of every single one, no skips, no crumbs left behind π:
zuuid_new (void)β creates a brand new UUID object. main character origin story.zuuid_new_from (const byte *source)β creates a UUID object from a suppliedZUUID_LEN-octet value. πzuuid_destroy (zuuid_t **self_p)β destroys a specified UUID object. it's over, she said goodbye πzuuid_set (zuuid_t *self, const byte *source)β sets the UUID to a new suppliedZUUID_LEN-octet value.zuuid_set_str (zuuid_t *self, const char *source)β sets the UUID to a new supplied string value, and it skips'-'and'{' '}'optional delimiters while it's at it. returns0if OK, else it returns-1. lowkey forgiving, highkey precise.zuuid_data (zuuid_t *self)β returns the UUID binary data.zuuid_size (zuuid_t *self)β returns the UUID binary size.zuuid_str (zuuid_t *self)β returns the UUID as a string.zuuid_str_canonical (zuuid_t *self)β returns the UUID in the canonical string format:8-4-4-4-12, in lower case. the caller does not modify or free the returned value. seehttp://en.wikipedia.org/wiki/Universally_unique_identifier. πzuuid_export (zuuid_t *self, byte *target)β stores the UUID blob in the target array.zuuid_eq (zuuid_t *self, const byte *compare)β checks if the UUID is the same as the supplied value. twin check β¨zuuid_neq (zuuid_t *self, const byte *compare)β checks if the UUID is different from the supplied value. not-twins check πzuuid_dup (zuuid_t *self)β makes a copy of the UUID object; if uuid is null, or memory was exhausted, it returns null. πzuuid_test (bool verbose)β self test of this class. she tests herself, as she should.
also, a note straight from the source: please add '@interface' section in './../src/zuuid.c'. π
π DESCRIPTION π
the zuuid class generates UUIDs and provides methods for working with them. it's giving utility queen.
if you build CZMQ with libuuid, on Unix/Linux, it will use that library. on Windows it will use UuidCreate(). otherwise it will use a random number generator to produce convincing imitations of UUIDs. not real, but she serves real. π
also, please add @discuss section in ./../src/zuuid.c. bestie the docs are asking politely, don't leave them on read. π«Ά
π EXAMPLE π
from the zuuid_test method, verbatim, no cap:
// Simple create/destroy test
assert (ZUUID_LEN == 16);
assert (ZUUID_STR_LEN == 32);
zuuid_t *uuid = zuuid_new ();
assert (uuid);
assert (zuuid_size (uuid) == ZUUID_LEN);
assert (strlen (zuuid_str (uuid)) == ZUUID_STR_LEN);
zuuid_t *copy = zuuid_dup (uuid);
assert (streq (zuuid_str (uuid), zuuid_str (copy)));
// Check set/set_str/export methods
const char *myuuid = "8CB3E9A9649B4BEF8DE225E9C2CEBB38";
const char *myuuid2 = "8CB3E9A9-649B-4BEF-8DE2-25E9C2CEBB38";
const char *myuuid3 = "{8CB3E9A9-649B-4BEF-8DE2-25E9C2CEBB38}";
const char *myuuid4 = "8CB3E9A9649B4BEF8DE225E9C2CEBB3838";
int rc = zuuid_set_str (uuid, myuuid);
assert (rc == 0);
assert (streq (zuuid_str (uuid), myuuid));
rc = zuuid_set_str (uuid, myuuid2);
assert (rc == 0);
assert (streq (zuuid_str (uuid), myuuid));
rc = zuuid_set_str (uuid, myuuid3);
assert (rc == 0);
assert (streq (zuuid_str (uuid), myuuid));
rc = zuuid_set_str (uuid, myuuid4);
assert (rc == -1);
byte copy_uuid [ZUUID_LEN];
zuuid_export (uuid, copy_uuid);
zuuid_set (uuid, copy_uuid);
assert (streq (zuuid_str (uuid), myuuid));
// Check the canonical string format
assert (streq (zuuid_str_canonical (uuid),
"8cb3e9a9-649b-4bef-8de2-25e9c2cebb38"));
zuuid_destroy (&uuid);
zuuid_destroy (©);
#if defined (__WINDOWS__)
zsys_shutdown();
#endif
see how she ate that? π₯ canonical format coming out lowercase and hyphenated exactly like 8cb3e9a9-649b-4bef-8de2-25e9c2cebb38. iconic.
π¦ AUTHORS π¦
the czmq manual was written by the authors in the AUTHORS file. credit where credit is due, always. π
πΈ RESOURCES πΈ
Main web site:
ngl bestie the page literally just says "Main web site:" and then nothing. no link. leaving us on read. π that's the whole line, we're not making anything up.
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.orgβmailto:zeromq-dev@lists.zeromq.org
and that's the whole page bestie, love that for us π«Ά this was CZMQ 4.2.1, dated 01/16/2026, and it's giving ZUUID(3) energy from start to finish. slay, stay unique (universally), byeee π
β¨π
π¦ 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