Download src/gemini/utils/hash.ts from TTOPM/belel-protocol: direct link, hf CLI and curl.
- Browser
- Download file 261 Bytes
-
https://huggingface.co/TTOPM/belel-protocol/resolve/main/src/gemini/utils/hash.ts
- Command line
-
hf download hf://TTOPM/belel-protocol/src/gemini/utils/hash.ts
-
curl -L -o hash.ts https://huggingface.co/TTOPM/belel-protocol/resolve/main/src/gemini/utils/hash.ts
261 Bytes
| import crypto from "node:crypto"; | |
| export function sha256Hex(s: string) { return crypto.createHash("sha256").update(s).digest("hex"); } | |
| export function hmacSHA256(key: Buffer, data: string) { return crypto.createHmac("sha256", key).update(data).digest("hex"); } | |