crypto nodejs
const crypto = require('crypto');
const secret = 'abcdefg';
const hash = crypto.createHmac('sha256', secret)
.update('I love cupcakes')
.digest('hex');
console.log(hash);
// Prints:
// c0fa1bc00531bd78ef38c628449c5102aeabd49b5dc3a2a516ea6ea959d6658e
//To create a random string using crypto
require('crypto').randomBytes(64).toString('hex')
//3f19d8644bcb8afa0668ac2d9bffd5c88b85c165ccb0546622305911659ab3361b62acc3dd87097c7280e31517fd4a3413c553787da9805397a22c89a4ed98da
Also in JavaScript:
- clearing cookie in js
- js if char in string
- react router external link
- how to validate file extension in javascript
- foreach await js
- javascript onclick select coordinates
- jquery on modal show
- js api call
- how to get json file in javascript
- loop key in object
- javascript run something after x seconds
- circle collision javascript
- colab notebook keeps getting disconnected
- how to turn decimales into percents with javascript
- comment out in javascript
- js if dark mode
- dark mode with react hooks
- how to make an if statement in javascript
- créer composant react
- ssr in angular 9 example
- how to use if else inside jsx in react
- javascript regex email
- what is Vanilla JavaScript
- javascript round decimal 2 digits