UNPKG

@donation-alerts/api

Version:
15 lines (14 loc) 611 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.createSha256SignatureFromParams = createSha256SignatureFromParams; const shared_utils_1 = require("@stimulcross/shared-utils"); const cross_sha256_1 = require("cross-sha256"); /** @internal */ function createSha256SignatureFromParams(params, secret) { const valuesString = Object.values((0, shared_utils_1.flattenObject)(params)) .filter(v => v !== undefined) .map(e => String(e)) .toSorted() .join(''); return new cross_sha256_1.sha256().update(valuesString + secret).digest('hex'); }