Files
klz-cables.com/.pnpm-store/v10/files/24/ee328f3e9ddd9145dc0c871439b578aa0314730dd146e4a396f60e87586046ddea4737b00d1f7f7469c3bc5b5c2a9e2d47d8584191803da768239359c6331d
Marc Mintel 5397309103
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
fix(products): fix breadcrumbs and product filtering (backport from main)
2026-02-24 16:04:21 +01:00

18 lines
623 B
Plaintext

import * as crypto from 'node:crypto';
import { promisify } from 'node:util';
import nodeDigest from './dsa_digest.js';
import hmacDigest from './hmac_digest.js';
import nodeKey from './node_key.js';
import getSignKey from './get_sign_verify_key.js';
const oneShotSign = promisify(crypto.sign);
const sign = async (alg, key, data) => {
const k = getSignKey(alg, key, 'sign');
if (alg.startsWith('HS')) {
const hmac = crypto.createHmac(hmacDigest(alg), k);
hmac.update(data);
return hmac.digest();
}
return oneShotSign(nodeDigest(alg), data, nodeKey(alg, k));
};
export default sign;