MCPcopy Create free account
hub / github.com/scriptscat/scriptcat / hmacSha256

Function hmacSha256

packages/filesystem/s3/client.ts:37–41  ·  view source on GitHub ↗
(key: ArrayBuffer, data: string)

Source from the content-addressed store, hash-verified

35}
36
37async function hmacSha256(key: ArrayBuffer, data: string): Promise<ArrayBuffer> {
38 const cryptoKey = await crypto.subtle.importKey("raw", key, { name: "HMAC", hash: "SHA-256" }, false, ["sign"]);
39 const encoded = new TextEncoder().encode(data);
40 return crypto.subtle.sign("HMAC", cryptoKey, encoded.buffer as ArrayBuffer);
41}
42
43/** 派生 AWS Signature V4 签名密钥 */
44async function deriveSigningKey(

Callers 2

deriveSigningKeyFunction · 0.85
signRequestMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected