Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(examples): add p/demo/seqid #1378

Merged
merged 5 commits into from
Nov 16, 2023
Merged

feat(examples): add p/demo/seqid #1378

merged 5 commits into from
Nov 16, 2023

Conversation

thehowl
Copy link
Member

@thehowl thehowl commented Nov 16, 2023

A very simple ID generation package, designed to be used in combination with avl.Trees to push values in order.

The name was originally seqid (sequential IDs), but after saying it a few times I realised it was close to "squid" and probably would be more fun if I named it that way ;)

There's another piece of functionality that I want to add, which is a way to create simple base32-encoded IDs. This depends on #1290. These would also guarantee alphabetical ordering, so a list of them can be easily sorted and you'd get it in the same order they were created. They would likely be 13 characters long, but I'm also thinking of making a compact version which works from [0,2^35) which is 7 chracters, and then smoothly transitions over to the 13 characters version when the ID is reached.

(I've experience with both base64 and base32 encoded IDs as 64-bit numbers, as I used both systems. The advantage of base32 is that it makes IDs case insensitive, all the while being at most 13 bytes instead of 11 for base64.)

In GnoChess, we used simple sequential IDs combined with zeroPad9 to create IDs which were both readable and sortable. I want to make a more "canonical" solution to this which does not have a upper limit at 1 billion entries.

@thehowl thehowl added 🌱 feature New update to Gno 🧾 package/realm Tag used for new Realms or Packages. labels Nov 16, 2023
@thehowl thehowl self-assigned this Nov 16, 2023
@thehowl thehowl requested a review from a team as a code owner November 16, 2023 15:49
Copy link

codecov bot commented Nov 16, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (7d66398) 55.94% compared to head (a4511f9) 47.17%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1378      +/-   ##
==========================================
- Coverage   55.94%   47.17%   -8.78%     
==========================================
  Files         420      372      -48     
  Lines       65415    61720    -3695     
==========================================
- Hits        36596    29115    -7481     
- Misses      25961    30220    +4259     
+ Partials     2858     2385     -473     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@thehowl thehowl changed the title feat(examples): add p/demo/squid feat(examples): add p/demo/seqid Nov 16, 2023
@thehowl thehowl merged commit 24d89a4 into master Nov 16, 2023
182 of 183 checks passed
@thehowl thehowl deleted the dev/morgan/seqid branch November 16, 2023 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🧾 package/realm Tag used for new Realms or Packages. 🌱 feature New update to Gno
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants