Download packages/core/src/util/hash.ts from SaylorTwift/opencode: direct link, hf CLI and curl.
- Browser
- Download file 306 Bytes
-
https://huggingface.co/SaylorTwift/opencode/resolve/main/packages/core/src/util/hash.ts
- Command line
-
hf download hf://SaylorTwift/opencode/packages/core/src/util/hash.ts
-
curl -L -o hash.ts https://huggingface.co/SaylorTwift/opencode/resolve/main/packages/core/src/util/hash.ts
306 Bytes
| import { createHash } from "crypto" | |
| export namespace Hash { | |
| export function fast(input: string | Buffer): string { | |
| return createHash("sha1").update(input).digest("hex") | |
| } | |
| export function sha256(input: string | Buffer): string { | |
| return createHash("sha256").update(input).digest("hex") | |
| } | |
| } | |