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

fix(node): use webcrypto export from node:crypto #448

Merged
merged 1 commit into from
Oct 15, 2023
Merged

fix(node): use webcrypto export from node:crypto #448

merged 1 commit into from
Oct 15, 2023

Conversation

brc-dd
Copy link
Contributor

@brc-dd brc-dd commented Oct 15, 2023

Using crypto.webcrypto.getRandomValues() is recommended instead of directly using the aliased version from crypto.getRandomValues() as the latter is not meant to be compatible with the WebCrypto spec and is non-standard.

There was earlier discussion on this in the node repo - nodejs/node#41779, nodejs/node#41782, nodejs/node#41760

This is breaking some downstream tools as well that are bundling / down-compiling nanoid (although that's not much of an nanoid issue).

PS: updating the clean script as well. Running test was failing for new contributors who don't already have a coverage directory.

@ai ai merged commit 4823585 into ai:main Oct 15, 2023
3 checks passed
@ai
Copy link
Owner

ai commented Oct 15, 2023

Thanks. The fix was released in 5.0.2.

@brc-dd brc-dd deleted the fix/use-webcrypto-export branch October 15, 2023 12:15
brc-dd added a commit to vuejs/vitepress that referenced this pull request Oct 15, 2023
bumping nanoid again to v5 -- issue regarding crypto.getRandomValues is resolved upstream -- ai/nanoid#448
jasonreyes9 added a commit to jasonreyes9/vitepress-vuejs that referenced this pull request Oct 31, 2023
bumping nanoid again to v5 -- issue regarding crypto.getRandomValues is resolved upstream -- ai/nanoid#448
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.

2 participants