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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

random: Implement Random#uuid #6319

Closed
wants to merge 1 commit into from

Conversation

woodruffw
Copy link
Contributor

This method behaves identically to Ruby's SecureRandom#uuid,
generating a random v4 UUID (with only the version and variant being
constant/determined).

Please let me know if there's a way to do this that involves fewer allocations 馃檪

This method behaves identically to Ruby's `SecureRandom#uuid`,
generating a random v4 UUID (with only the version and variant being
constant/determined).
@jkthorne
Copy link
Contributor

jkthorne commented Jul 2, 2018

Have you seen these api docs?
https://crystal-lang.org/api/0.25.1/UUID.html

@ysbaddaden
Copy link
Contributor

Yes, we already have UUID.random that doesn't allocate. Please use it :-)

@ysbaddaden ysbaddaden closed this Jul 2, 2018
@woodruffw
Copy link
Contributor Author

Not sure how I missed that. Sorry!

@woodruffw woodruffw deleted the random-uuid branch July 2, 2018 23:08
@ysbaddaden
Copy link
Contributor

Probably because it's reversed from Ruby (SecureRandom.uuid => UUID.random) since we have an UUID type.

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

Successfully merging this pull request may close these issues.

None yet

3 participants