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

Make uuid v4 rfc4122 compliant #580

merged 3 commits into from Sep 11, 2019


Copy link

commented Sep 3, 2019

UUID v4 is not currently RFC4122 compliant, the 8 is hard-coded

return "00000000-0000-4000-8000-000000000000".replace(

Loosely based of

Went with the cleanest approach to convert Uint8Array to string, I could unwrap looping since the array contains 16 elements, if needed.
Let me know if any changes are required I'll make them.

Related to and fixes #559


This comment has been minimized.

Copy link

commented Sep 3, 2019

CLA assistant check
All committers have signed the CLA.

M4rk9696 added 2 commits Sep 3, 2019
ry approved these changes Sep 11, 2019
Copy link

left a comment

LGTM - I guess fewer calls to getRandomValues is better.

Tho I can't tell if there's any functional difference between the previous version...

@ry ry merged commit ba69f1e into denoland:master Sep 11, 2019
5 checks passed
5 checks passed
denoland.deno_std Build #20190903.10 succeeded
denoland.deno_std (Linux) Linux succeeded
denoland.deno_std (Mac) Mac succeeded
denoland.deno_std (Windows) Windows succeeded
license/cla Contributor License Agreement is signed.
ry added a commit to ry/deno that referenced this pull request Oct 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants
You can’t perform that action at this time.