Skip to content

Tag: cryptography

Use window.crypto in nodejs code

I am trying to use the window.crypto.getRandomValues method in a nodejs script. From my understanding there is no window element when I run a simple code like this in node: Which is why I get this error: How can I use this method in my code? Thanks Answer You can use the built-in crypto module instead. It pro…