Re:Understanding UUIDs, ULIDs and string representations
by voidfunc on Wednesday January 05, 2022 @12:55AM
(#29805658)
Most people are familiar with time and random UUIDs but and I had sort of known about v5 UUIDs but recently used them to get consistent identifiers from an input value… super useful because you can do `uuidv5($namespace_uuid, data)` and get the same UUID everytime.
[ Parent
| on HN ]
Re:Understanding UUIDs, ULIDs and string representations
by JimDabell on Wednesday January 05, 2022 @03:14AM
(#29806437)
Isn’t that just a hash?
Re:Understanding UUIDs, ULIDs and string representations
by drewcoo on Wednesday January 05, 2022 @03:30AM
(#29806536)
If you have data-driven tests that compute UUIDs along the way to their results, plopping in an UUID generator that is a predictable hash algo is a good thing.
This is similar to C rand(), which you wouldn't want to use in production but is useful when generating the same test data for the same seed every time.
Re:Understanding UUIDs, ULIDs and string representations
by keosak on Wednesday January 05, 2022 @03:39AM
(#29806593)
It is a hash, but in the format of a UUID. This is useful if you are storing it in the database, since there is usually a dedicated data type for UUIDs. Also, you can mix UUID v4 and v5 IDs freely.