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

What is the purpose of window.crypto.getRandomValues(d)? #3

Open
r0hin opened this issue Jul 16, 2023 · 2 comments
Open

What is the purpose of window.crypto.getRandomValues(d)? #3

r0hin opened this issue Jul 16, 2023 · 2 comments

Comments

@r0hin
Copy link

r0hin commented Jul 16, 2023

(Ln 39), it does not look like this method is being used.

This line also prevents isaacCSPRNG from being run on NodeJS since the window.crypto object is undefined.

Should it be removed?

@macmcmeans
Copy link
Owner

macmcmeans commented Aug 11, 2023

Hey @r0hin, thanks for the question!

The logic on line 39 creates a default random seed in the event the user does not specify one. It is always invoked, but the result is not always used.

If you're looking to bring this into NodeJS, you'll find some tips here:
https://stackoverflow.com/questions/25725596/use-window-crypto-in-nodejs-code

@r0hin
Copy link
Author

r0hin commented Aug 12, 2023

I understand! Thanks for the answer (and library).

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

2 participants