Spaces:
Running
Running
Download server/accessKeyTestUtils.ts from Felladrin/MiniSearch: direct link, hf CLI and curl.
- Browser
- Download file 469 Bytes
-
https://huggingface.co/spaces/Felladrin/MiniSearch/resolve/main/server/accessKeyTestUtils.ts
- Command line
-
hf download hf://spaces/Felladrin/MiniSearch/server/accessKeyTestUtils.ts
-
curl -L -o accessKeyTestUtils.ts https://huggingface.co/spaces/Felladrin/MiniSearch/resolve/main/server/accessKeyTestUtils.ts
469 Bytes
| /** | |
| * A well-formed argon2id hash string with the client's fixed parameters | |
| * (m=512, t=16, p=1). The suffix makes each call unique, so the same suffix | |
| * is treated as the same token by the rejection cache. | |
| */ | |
| export function argon2idHash(suffix: string): string { | |
| const salt = Buffer.from(`${suffix}salt`).toString("base64url"); | |
| const digest = Buffer.from(`${suffix}digest`).toString("base64url"); | |
| return `$argon2id$v=19$m=512,t=16,p=1$${salt}$${digest}`; | |
| } | |