27 #include <arpa/inet.h>
30 #include <uuid/uuid.h>
39 memcpy((uuid->uuid).value, hash, 16);
41 (uuid->uuid).elements.time_low =
42 ntohl((uuid->uuid).elements.time_low);
43 (uuid->uuid).elements.time_mid =
44 ntohs((uuid->uuid).elements.time_mid);
45 (uuid->uuid).elements.time_hi_version =
46 ntohs((uuid->uuid).elements.time_hi_version);
49 (uuid->uuid).elements.time_hi_version &= 0x0FFF;
50 (uuid->uuid).elements.time_hi_version |= (version << 12);
51 (uuid->uuid).elements.clk_seq_hi_res &= 0x3F;
52 (uuid->uuid).elements.clk_seq_hi_res |= 0x80;