Wednesday, August 05, 2020

How to quickly create cryptographic secrets using nodejs

This was stolen adapted from JWT Authentication Tutorial - Node.js by @DevSimplified.

First, start up node from a terminal. Then type the following:

This will simply 

First, start up node from a terminal. Then execute the following line:
The result will be a secret token.

Here's the same thing as an executable JavaScript file, which outputs the token as both hex and base64: