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

Add UUID version 7 #54834

Merged
merged 3 commits into from
Jun 18, 2024
Merged

Add UUID version 7 #54834

merged 3 commits into from
Jun 18, 2024

Conversation

Seelengrab
Copy link
Contributor

@Seelengrab Seelengrab commented Jun 17, 2024

This PR does two things:

  • Add uuid7() & tests
  • Document the tests better, so that future people have an easier time figuring out what is being tested

@Seelengrab Seelengrab added the stdlib Julia's standard library label Jun 17, 2024
@nsajko nsajko added the feature Indicates new feature / enhancement requests label Jun 17, 2024
@DilumAluthge
Copy link
Member

Do we plan on using version 7 UUIDs in Julia/Pkg? If not, could we add this functionality to a package, instead of adding it to a stdlib?

@Seelengrab
Copy link
Contributor Author

Why not add it to UUIDs, the probably most widely used UUID package? What harm does this do here? It's not like there are any UUID user packages (other than Libuuid_jll) at all, and I'd really like to avoid registering a new package for 12 LOC (without docs) that fit perfectly into this existing code.

@oscardssmith
Copy link
Member

Since it is only 7 lines of simple code, I think it probably makes sense to keep UUID7 with UUIDs.jl.

@Seelengrab
Copy link
Contributor Author

The failure seems like a race condition in some other part of the testsuite. The commit running here only changed NEWS.md, so no functional changes were made. The commit before that one ran through successfully.

@staticfloat
Copy link
Member

I agree that this is the most logical place to collect UUID-related code. Additionally, it's a nice benefit at very little cost, so I agree we should merge it. Thanks, @Seelengrab!

@staticfloat staticfloat merged commit 0d30be8 into JuliaLang:master Jun 18, 2024
9 checks passed
@@ -58,6 +58,7 @@ New library functions
* `logrange(start, stop; length)` makes a range of constant ratio, instead of constant step ([#39071])
* The new `isfull(c::Channel)` function can be used to check if `put!(c, some_value)` will block. ([#53159])
* `waitany(tasks; throw=false)` and `waitall(tasks; failfast=false, throw=false)` which wait multiple tasks at once ([#53341]).
* `uuid7()` creates an RFC 9652 compliant UUID with version 7 ([#54834]).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if this is worth fixing, but this line should've probably went to the Standard library changes section below, under "UUIDs".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Indicates new feature / enhancement requests stdlib Julia's standard library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants