Files
NapCatQQ/.pnpm-store/v3/files/42/c535e57eb07a6dace720bf3ca236995e880e848295e7392428887466d7d42603df430783b7fc738a6f71cdb810f0dc191ca3a1c3b55d9061f4c0ce2c3c7f94
TanTan e311ca3275
Build NapCat Artifacts / Windows Loader Test (push) Canceled after 0s
Build NapCat Artifacts / Type Check & Test (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Framework (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Shell (push) Canceled after 0s
docs: 仓库链接指向本镜像仓库
2026-11-13 09:25:58 +08:00

15 lines
570 B
Plaintext

import { mapCoseAlgToWebCryptoAlg } from './mapCoseAlgToWebCryptoAlg.js';
import { getWebCrypto } from './getWebCrypto.js';
/**
* Generate a digest of the provided data.
*
* @param data The data to generate a digest of
* @param algorithm A COSE algorithm ID that maps to a desired SHA algorithm
*/
export async function digest(data, algorithm) {
const WebCrypto = await getWebCrypto();
const subtleAlgorithm = mapCoseAlgToWebCryptoAlg(algorithm);
const hashed = await WebCrypto.subtle.digest(subtleAlgorithm, data);
return new Uint8Array(hashed);
}