Spaces:
Sleeping
Sleeping
Download src/lib/computeSha256.ts from Joshleeave/AIComicFactory: direct link, hf CLI and curl.
- Browser
- Download file 331 Bytes
-
https://huggingface.co/spaces/Joshleeave/AIComicFactory/resolve/main/src/lib/computeSha256.ts
- Command line
-
hf download hf://spaces/Joshleeave/AIComicFactory/src/lib/computeSha256.ts
-
curl -L -o computeSha256.ts https://huggingface.co/spaces/Joshleeave/AIComicFactory/resolve/main/src/lib/computeSha256.ts
331 Bytes
| import { createHash } from 'node:crypto' | |
| /** | |
| * Returns a SHA256 hash using SHA-3 for the given `content`. | |
| * | |
| * @see https://en.wikipedia.org/wiki/SHA-3 | |
| * | |
| * @param {String} content | |
| * | |
| * @returns {String} | |
| */ | |
| export function computeSha256(strContent: string) { | |
| return createHash('sha3-256').update(strContent).digest('hex') | |
| } |