···7788ImplList(HexByte)
991010+// INFO: This monstrosity looks like this because I didn't see the use of
1111+// writing a for-loop for 36 bytes.
1012UUID_Str utoa(UUID uuid) {
1113 HexByte b01 = to_hex1((Byte)(uuid.id1 >> 24) & 0xFF);
1214 HexByte b02 = to_hex1((Byte)(uuid.id1 >> 16) & 0xFF);
···2729 return (UUID_Str){ .uuid = { b01.l, b01.r, b01.l, b01.r, b02.l, b02.r, b03.l, b03.r, b04.l, b04.r, '-', b05.l, b05.r, b06.l, b06.r, '-', b07.l, b07.r, b08.l, b08.r, '-', b09.l, b09.r, b10.l, b10.r, '-', b11.l, b11.r, b12.l, b12.r, b13.l, b13.r, b14.l, b14.r, b15.l, b15.r, b16.l, b16.r, '\0' } };
2830}
29313030-3132bool UUID_eq(UUID l, UUID r) {
3233 return l.id1 == r.id1
3334 && l.id2 == r.id2
···3536 && l.id4 == r.id4
3637 && l.id5 == r.id5;
3738}
3838-39394040Buffer UUID_serialize(UUID in) {
4141 return to_buffer(&in, sizeof(UUID));
···114114 free(kod);
115115 }
116116117117+ // INFO: This is necessary to avoid the "conversion" warning because you're
118118+ // assigning a uint64_t to a uint64_t:48 (which is 16 bits less).
117119#pragma GCC diagnostic push
118120#pragma GCC diagnostic ignored "-Wconversion"
119121 return (UUID) {
+10
src/lib/uuid.h
···45454646DefList(HexByte)
47474848+/// Convert a UUID into a string.
4949+/// In order to actually get the string, you have to do:
5050+/// \code{.c}
5151+/// utoa(your_id_here).uuid;
5252+/// \endcode
5353+///
5454+/// INFO: The caller does not have to free the memory! ;)
5555+///
5656+/// @param uuid the UUID that you want a string for
5757+/// @return a UUID_Str representing that UUID
4858UUID_Str utoa(UUID uuid);
49595060/// Serialize a UUID into a Buffer.