UNPKG

hash-fns

Version:

easily create, assess, and assure hashes within a pit-of-success

19 lines 650 B
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.asHashSha256Sync = void 0; const crypto_1 = __importDefault(require("crypto")); /** * hashes a string w/ sha256 * * note * - sync version is only available in node env * * ref * - https://stackoverflow.com/a/27970509/3068233 */ const asHashSha256Sync = (data) => crypto_1.default.createHash('sha256').update(data).digest('hex'); exports.asHashSha256Sync = asHashSha256Sync; //# sourceMappingURL=asHashSha256Sync.js.map