UNPKG

@beenotung/tslib

Version:
9 lines (8 loc) 307 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.hash = hash; const crypto_1 = require("crypto"); /** only works in node.js (using crypto module) */ function hash(content, algorithm = 'sha256') { return (0, crypto_1.createHash)(algorithm).update(content).digest(); }