Spaces:
Sleeping
Sleeping
Download apps/server/src/kernel/app-key.ts from phucsd/Oloka-Video-Dev: direct link, hf CLI and curl.
- Browser
- Download file 489 Bytes
-
https://huggingface.co/spaces/phucsd/Oloka-Video-Dev/resolve/main/apps/server/src/kernel/app-key.ts
- Command line
-
hf download hf://spaces/phucsd/Oloka-Video-Dev/apps/server/src/kernel/app-key.ts
-
curl -L -o app-key.ts https://huggingface.co/spaces/phucsd/Oloka-Video-Dev/resolve/main/apps/server/src/kernel/app-key.ts
489 Bytes
| export function decodeApplicationKey(encoded: string): Uint8Array { | |
| if (!/^[A-Za-z0-9_-]+$/.test(encoded)) { | |
| throw new Error("OLOKA_APP_KEY must be unpadded base64url"); | |
| } | |
| const decoded = Buffer.from(encoded, "base64url"); | |
| if (decoded.length !== 32) { | |
| throw new Error("OLOKA_APP_KEY must decode to exactly 32 bytes"); | |
| } | |
| if (decoded.toString("base64url") !== encoded) { | |
| throw new Error("OLOKA_APP_KEY must use canonical unpadded base64url"); | |
| } | |
| return decoded; | |
| } | |