Languages
[Edit]
EN

Node.js - encode text to SHA-1

0 points
Created by:
p_agon
409

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

Resources

  1. SHA-1 - Wikipedia

Node.js - crypto module

Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join