Files
NapCatQQ/.pnpm-store/v3/files/3e/f79e667c202af56536ecae04cce0f630a4a0671886fa446d0307f0c86a12ee981cc17292c32dce219857d33e26060e7ca3ba39e51cd6f1f531acbefb37d627
T
TanTan e311ca3275
Build NapCat Artifacts / Type Check & Test (push) Waiting to run
docs: 仓库链接指向本镜像仓库
2026-11-13 09:25:58 +08:00

16 lines
499 B
Plaintext

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.toHash = toHash;
const index_js_1 = require("./iso/index.js");
/**
* Returns hash digest of the given data, using the given algorithm when provided. Defaults to using
* SHA-256.
*/
function toHash(data, algorithm = -7) {
if (typeof data === 'string') {
data = index_js_1.isoUint8Array.fromUTF8String(data);
}
const digest = index_js_1.isoCrypto.digest(data, algorithm);
return digest;
}