Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

UUIDs don't use base64
 help



You can absolutely encode a UUID in base64, as you can any string of 128 bits.

128 random bits in some random format aren't a uuid. 0.2ml of water isn't a raindrop. If I say "you can provide me with a uuid" and you give me a base64-encoded string, it's getting rejected by validation. If I say "this text needs to be a Unicode string" and you give me a base64-encoded Unicode string's byte array, it's not going to go well.

Why are you implying that converting from base64 to and from standard UUID representation (hyphen-delimited hexadecimal) is more than a trivial operation? Either client or server can do this at any point.

Does Postgres not truly support UUID because it internally represents it as 128 bits instead of a huge number of encoded bytes in the standard representation? Of course not.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: