UNPKG

hakk

Version:

Interactive programming for Node.js. Speed up your JavaScript development!

8 lines (5 loc) 252 B
const { createHash } = require('node:crypto'); // Take a string and return the sha256 digest in a hex string (64 characters). const sha256 = (text) => createHash('sha256').update(text, 'utf8').digest().toString('hex'); module.exports = { sha256 };