RzNmKX / uuid7-flask

4 stars 0 forks source link

UUID7 generator on the website is based on an outdated draft, leading to incompatible timestamps #1

Closed dtinth closed 6 months ago

dtinth commented 6 months ago

The latest draft of UUIDv7 (linked from https://uuid7.com/) specifies that the first 48 bits in the UUID should be Unix epoch timestamp in milliseconds.

Example UUIDv7, should start with 01:

018e091e-f50e-7cdc-ab81-3a229244f547

However, the website generates a UUIDv7 based on an earlier draft, starting with 06.

065e5a96-172c-771e-8000-bbac546447e1

Given that this website is currently ranked first when searching for UUIDv7, I think the UUID generation algorithm should be updated.

See:

The original repo hasn’t been updated in 3 years, but a fork and a pull request that updates the generation algorithm exists:

RedSpid3r commented 6 months ago

Came here to report this as I opened an issue on the uuidv7 repro as my UUIDs were showing as 1983 and they confirmed it was an issue with the uuidv7 site

https://github.com/LiosK/uuidv7/issues/11

RzNmKX commented 6 months ago

Thank you both for the feedback, I am currently on vacation but should get this fixed within the next week or so

RzNmKX commented 6 months ago

fixed with the code from this PR https://github.com/stevesimmons/uuid7/pull/2

https://github.com/RzNmKX/uuid7-flask/blob/main/flask_app/uuid7.py