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: add p/uuid #2076
base: master
Are you sure you want to change the base?
feat: add p/uuid #2076
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #2076 +/- ##
==========================================
- Coverage 54.96% 54.96% -0.01%
==========================================
Files 481 481
Lines 67407 67407
==========================================
- Hits 37052 37049 -3
- Misses 27336 27337 +1
- Partials 3019 3021 +2 ☔ View full report in Codecov by Sentry. |
There is no other way to guarantee atomicity besides using time in environments where atomic is not supported. If we consider it further, it seems possible to generate a random value (using |
sequence uint16 = 0 | ||
StartTime = time.Date(2008, 11, 10, 23, 0, 0, 0, time.UTC) | ||
LastTimestamp int64 = 0 | ||
LastSequence uint32 = 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seeme like LastSequence
does not used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, I had forgotten to remove it after my tests for the resolver. Thanks
"gno.land/p/demo/ufmt" | ||
) | ||
|
||
// TestNextID vérifie la génération correcte des IDs Snowflake. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be nice to leave the comments in English
Thanks for your explanation. I will check the progress of |
I suggest adding a
UUID
package because I think it could be useful to have it available. I think it can further facilitate traceability and compatibility between different systems and apps as they would have a common standard for identifying entities.To improve
UUID
generation, I wanted to add a resolver likeSnowflake
, but from what I've searched,sync/atomic
is not supported on Gno. Is there another similar package that I might have missed ?