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

Is there a method to generate empty UUID v4? #104

Closed
fulviodenza opened this issue Jun 15, 2022 · 2 comments
Closed

Is there a method to generate empty UUID v4? #104

fulviodenza opened this issue Jun 15, 2022 · 2 comments

Comments

@fulviodenza
Copy link

Hi! I noticed there is a uuid.Nil for UUID v1 but no uuid.Nil (for example uuid.Nil4) for UUID v4 could be useful adding this method to the library? (I could also make a PR)

@fulviodenza fulviodenza changed the title Is there a method to generate UUID v4? Is there a method to generate empty UUID v4? Jun 15, 2022
@alexis-coulombe
Copy link

alexis-coulombe commented Jul 28, 2023

There's no difference in format between a v1 or v4, you could probably use this to generate an empty uuid

uuid/hash.go

Line 19 in 44b5fee

Nil UUID // empty UUID, all zeros

https://www.sohamkamani.com/uuid-versions-explained/#how-are-uuids-structured

@pborman
Copy link
Collaborator

pborman commented Jul 28, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants