isaacCSPRNG icon indicating copy to clipboard operation
isaacCSPRNG copied to clipboard

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

Open r0hin opened this issue 1 year ago • 2 comments

(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?

r0hin avatar Jul 16 '23 04:07 r0hin

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

macmcmeans avatar Aug 11 '23 19:08 macmcmeans

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

r0hin avatar Aug 12 '23 01:08 r0hin