kpdemetriou / fuuid

Functional UUIDs for Python.
BSD 3-Clause "New" or "Revised" License
146 stars 5 forks source link

Differences between fuuid and ulid #1

Open henricook opened 3 years ago

henricook commented 3 years ago

I woukd be interested in knowing the principle differences between fuuid and ulid - https://github.com/ulid/spec

timClicks commented 3 years ago

Am not the author of the library, but have done some research.

Superficially, ULIDs don't look like UUIDs, whereas FUUIDs do. ULIDs' canonical representation is 26 characters, whereas (F)UUIDs are 36.

FUUIDs are not necessarily valid UUIDs either, however. They don't set the version bits to a consistent version, e.g. UUIDv4. That may mean they won't pass downstream validation.

ULIDs have 80 bits of randomness. FUUIDs have either 96 bits of randomness when the timestamp parameter is at whole second precision, and 64 bits of randomness when the timestamp is at nanosecond precision.