shortuuid.rb
uulid.go
shortuuid.rb | uulid.go | |
---|---|---|
2 | 2 | |
61 | 31 | |
- | - | |
0.0 | 2.6 | |
almost 2 years ago | 6 months ago | |
Ruby | Go | |
MIT License | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
shortuuid.rb
- New UUID Formats – IETF Draft
-
A Bit Overcomplicated
At the risk of sounding stupid, I have no idea how bit-shifting and bitwise operators work, though I've worked in the field for over a decade and am now a Staff Engineer or whatever. There, I said it.
It's just something I haven't gotten around to reading yet. I suspect some code would be made clearer by it, but even when doing something similar I wound up using the math textbook was to do it even though I suspect the bit operators would be much faster.
https://github.com/sudhirj/shortuuid.rb/blob/master/lib/shor...
https://github.com/sudhirj/shortuuid.go/blob/master/shortuui...
uulid.go
-
New UUID Formats – IETF Draft
For those interested in time based UUIDs, I've written libraries in Ruby and Go to move quickly between them:
https://github.com/sudhirj/uulid.go
-
Timeflake: 128-bit, roughly-ordered, URL-safe UUIDs
There’s a spec called ULID that’s pretty much this with default base32 encoding
https://github.com/ulid/spec
I’ve also worked on a UUID-ULID bridge for Go
https://github.com/sudhirj/uulid.go
And seeing as this is just 128 bits it’s quite easy to move seamlessly between formats and representations.
I’ve found this concept especially useful in nosql stores like DynamoDB, where using a ULID primary key makes objects time sortable automatically. It’s also quite easy to query for items by zeroing out the random component and setting only the time stamp bytes.
What are some alternatives?
spec - The canonical spec for ulid
timeflake - Timeflake is a 128-bit, roughly-ordered, URL-safe UUID.
ulid-mssql - Implementation of ULID generator For Microsoft SQL Server
Ulid - Fast .NET C# Implementation of ULID for .NET and Unity.
Pomelo.EntityFrameworkCore.MySql - Entity Framework Core provider for MySQL and MariaDB built on top of MySqlConnector
ksuid - K-Sortable Globally Unique IDs
uuid6-ietf-draft - Next Generation UUID Formats
lexid - fast lexicographically orderable/sortable ID generator