News for hackers. Stuff that matters.
Re:Type-safe, K-sortable, globally unique identifier inspire... by tasn on Wednesday June 28, 2023 @03:31PM (#36511419)
We maintain a couple of popular ksuid libraries[1][2] and use it, so we definitely like ksuid. Though one big issue with ksuid is that being 160bit means that it doesn't fit into native uuid types in databases (e.g. postgres), which means that they come with a performance penalty.

1: https://github.com/svix/rust-ksuid 2: https://github.com/svix/python-ksuid

Re:Type-safe, K-sortable, globally unique identifier inspire... by Xeoncross on Wednesday June 28, 2023 @04:43PM (#36512321)
I'm curious, why do you not store these as binary data or do you and you're saying that the UUID operations are better optimized than sorts on binary data?
Re:Type-safe, K-sortable, globally unique identifier inspire... by snuxoll on Wednesday June 28, 2023 @05:56PM (#36513190)
I can compare a 128bit UUID in a single instruction, a 160-bit ksuid is a little weirder to work with at the hardware level.
Re:Type-safe, K-sortable, globally unique identifier inspire... by tasn on Wednesday June 28, 2023 @06:20PM (#36513445)
Exactly what the sibling said, and the same applies to database operations (when they have a uuid type).