EN
Node.js - encode text to SHA-1
0 points
In this article, we would like to show how to encode text to SHA-1 in Node.js.
xxxxxxxxxx
1
const crypto = require('crypto');
2
3
const data = 'dirask';
4
const sh1Data = crypto.createHash('sha1').update(data).digest('hex');
5
6
console.log(sh1Data) // 8867d36fe297487f78951976c6c3bd0653ffb05a