UUID_PARSE(3)

πŸ’… UUID_PARSE(3) β€” the manual, but make it group chat

okay so this is the uuid_parse page from the Programmers Manual β€” yes that's the actual manual section name, we love a formal queen πŸ’– β€” and it's genuinely so useful. Copy-pasting UUID strings into binary like a boss. Let's get into it bestie 🫢


✨ NAME ✨

uuid_parse β€” convert an input UUID string into its binary representation. that's the whole vibe. string in, bytes out, slay ✨


🌸 SYNOPSIS 🌸

#include <uuid.h>

int uuid_parse(const char *in, uuid_t uu);
int uuid_parse_range(const char *in_start, const char *in_end, uuid_t
uu);

yes bestie, that line break in the second declaration is in the original β€” we keep it exactly as is, no notes πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

so the uuid_parse() function takes the UUID string in in and converts it into the binary representation, lowkey iconic. the input UUID is a string shaped like this:

1b4e28ba-2fa1-11d2-883f-b9a761bde3fb

which is the printf(3) format "%08x-%04x-%04x-%04x-%012x" β€” that's 36 bytes plus the trailing '\0', no cap πŸŽ€

and then there's uuid_parse_range(), which works like uuid_parse() but parses only the range in the string specified by the in_start and in_end pointers. selective queen behavior, honestly πŸ‘‘


⭐ RETURN VALUE ⭐

  • when it successfully parses the input string, 0 is returned, and the UUID gets stored in the location pointed to by uu πŸŽ‰
  • otherwise? -1. that's it. that's the whole mood 😭

🌈 CONFORMING TO 🌈

this library parses UUIDs compatible with OSF DCE 1.1, plus hash based UUIDs V3 and V5 compatible with RFC-4122:

https://tools.ietf.org/html/rfc4122

standards-compliant AND cute, we contain multitudes πŸ’œ


🧚 AUTHORS 🧚

Theodore Y. Ts’o β€” the icon who made this happen πŸ‘‘βœ¨


πŸ“ SEE ALSO πŸ“

the whole friend group fr fr 🫢


πŸ’€ REPORTING BUGS πŸ’€

found a bug? don't suffer in silence bestie, use the issue tracker:

https://github.com/util-linux/util-linux/issues

they want to hear from you, periodt πŸ“’


πŸ”₯ AVAILABILITY πŸ”₯

the libuuid library is part of the util-linux package since version 2.15.1. you can download it from the Linux Kernel Archive:

https://www.kernel.org/pub/linux/utils/util-linux/


ngl the one thing to remember: 0 means bestie ate and the UUID is in uu, -1 means it did not eat. no in-between πŸ’…

and that's the page!! brought to you by util-linux 2.41.6 on 2026-08-31 β€” mwah, go parse something gorgeous πŸŒΈπŸ’–πŸ¦‹

πŸ“¦ where this page comes from