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.
Using Node.js built-in module - Crypto
const crypto = require('crypto');
const data = 'dirask';
const sh1Data = crypto.createHash('sha1').update(data).digest('hex');
console.log(sh1Data) // 8867d36fe297487f78951976c6c3bd0653ffb05a