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

api.Crypto.getRandomValues - Wrong version listed for NodeJS #20752

Closed
DesignByOnyx opened this issue Sep 19, 2023 · 2 comments · Fixed by #21414
Closed

api.Crypto.getRandomValues - Wrong version listed for NodeJS #20752

DesignByOnyx opened this issue Sep 19, 2023 · 2 comments · Fixed by #21414
Labels
data:api Compat data for Web APIs. https://developer.mozilla.org/docs/Web/API

Comments

@DesignByOnyx
Copy link

What type of issue is this?

Incorrect support data (example: Chrome says "86" but support was added in "40")

What information was incorrect, unhelpful, or incomplete?

MDN says Node.js added support in v15.0.0, but the Node.js website says v17.4.0

What browsers does this problem apply to, if applicable?

No response

What did you expect to see?

v17.4.0

Did you test this? If so, how?

I tested on Node 16 and confirmed it is not there. Here are a couple docker commands you can use to test:

# does not work
docker run  --rm -it node:16-alpine node -e "require('crypto').getRandomValues(new Uint32Array(1))"
docker run  --rm -it node:17.3-alpine node -e "require('crypto').getRandomValues(new Uint32Array(1))"

# does work
docker run  --rm -it node:17.4-alpine node -e "require('crypto').getRandomValues(new Uint32Array(1))"

Can you link to any release notes, bugs, pull requests, or MDN pages related to this?

No response

Do you have anything more you want to share?

No response

MDN URL

https://developer.mozilla.org/en-US/docs/Web/API/Crypto/getRandomValues

MDN metadata

MDN page report details
  • Query: api.Crypto.getRandomValues
  • Report started: 2023-09-19T19:48:12.424Z
@queengooborg queengooborg added the data:api Compat data for Web APIs. https://developer.mozilla.org/docs/Web/API label Sep 19, 2023
@queengooborg
Copy link
Contributor

Looks like the version number was added in #7283. It appears that there's an error in the docs on the paths referenced in that PR. I trust your tests and the document you linked much more.

queengooborg added a commit to queengooborg/browser-compat-data that referenced this issue Dec 2, 2023
This PR updates and corrects version values for NodeJS for the `getRandomValues` member of the `Crypto` API. This fixes mdn#20752, which is where the data comes from.
Elchi3 pushed a commit that referenced this issue Dec 8, 2023
This PR updates and corrects version values for NodeJS for the `getRandomValues` member of the `Crypto` API. This fixes #20752, which is where the data comes from.
@skyclouds2001
Copy link
Contributor

skyclouds2001 commented Nov 6, 2024

I think the test and the link to the docs is not correct.

This use the link of the getRandomValues() method of crypto module (which says v17.4.0), NOT the getRandomValues() method of Web Crypto API (which says v15.0.0). Also notice that, the getRandomValues() method of crypto module is simply a convenient alias of the getRandomValues() method of Web Crypto API.

The correct test should be require('crypto').webcrypto.getRandomValues(new Uint32Array(1)), and the correct link should be https://nodejs.org/docs/latest/api/webcrypto.html#class-crypto

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
data:api Compat data for Web APIs. https://developer.mozilla.org/docs/Web/API
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants