"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.toSha256 = exports.hash = void 0;
const tslib_1 = require("tslib");
const node_crypto_1 = tslib_1.__importDefault(require("node:crypto"));
const defaultAlgorithm = 'sha512';
function hash(data, algorithm) {
    const selectedAlgorithm = algorithm ?? defaultAlgorithm;
    const hash = node_crypto_1.default.createHash(selectedAlgorithm);
    hash.update(data);
    return hash.digest('hex');
}
exports.hash = hash;
function toSha256(input) {
    return hash(input, 'sha256');
}
exports.toSha256 = toSha256;
//# sourceMappingURL=hash.js.map