24 #include <sys/types.h>
27 #include <openssl/sha.h>
30 #include <arpa/inet.h>
42 unsigned char hash[20];
43 Uuid net_nsid =
clone(nsid);
44 Uuid uuid =
new(Uuid);
49 (net_nsid->uuid).elements.time_low =
50 htonl((net_nsid->uuid).elements.time_low);
51 (net_nsid->uuid).elements.time_mid =
52 htons((net_nsid->uuid).elements.time_mid);
53 (net_nsid->uuid).elements.time_hi_version =
54 htons((net_nsid->uuid).elements.time_hi_version);
60 SHA1_Update(&ctx, (net_nsid->uuid).value, 16);
61 SHA1_Update(&ctx, name, nname);
62 SHA1_Final(hash, &ctx);
Uuid uuidVersion5(const unsigned char *name, size_t nname, Uuid nsid)
void _uuidFormat3or5(Uuid uuid, unsigned char hash[16], int version)