-
-
Notifications
You must be signed in to change notification settings - Fork 77
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
About the time of UUIDv1 generation #119
Comments
if change file:
|
Because Javascript does not have millisecond precision for time due to limitations of integers in JS (they are only 53bits, a long is 64bits, which is what dart uses for millisecondsFromEpoch). And this library needs to work in DartJS and other targets. It used to be milliseconds until I got bug reports to the contrary. I use the alternative method of NodeID + ClockSeq to deal with that, which is part of the spec. |
I tried changing the microsecondsSinceEpoch in the code to millisecondsSinceEpoch, and then running it in chrome v125 using flutter web and the results I saw were the same. |
Ok, maybe the issue was fixed. I will make the change and make sure all my tests are passing and verify some other stuff. |
ok~thx |
Thank you for catching this. It seems this was an error on my part when I was refactoring/rebasing the version 4 release. It should have been millisecondsSinceEpoch, just like UUIDv6, but somehow got changed to microseconds. I have added a test to catch this in the future. v4.4.1 is pushed, that includes the fix. |
code:
output:
I tried to generate a uuidv1 in python, and the time parsed by the code is normal. However, the time of the uuidv1 generated in our library is abnormal. Why is this happening?
I also used uuidtools, also with the same result.
The text was updated successfully, but these errors were encountered: