Spaces:
Paused
Paused
Download src/lib/serverUtils.ts from pjpjq/perplexica-auth: direct link, hf CLI and curl.
- Browser
- Download file 238 Bytes
-
https://huggingface.co/spaces/pjpjq/perplexica-auth/resolve/main/src/lib/serverUtils.ts
- Command line
-
hf download hf://spaces/pjpjq/perplexica-auth/src/lib/serverUtils.ts
-
curl -L -o serverUtils.ts https://huggingface.co/spaces/pjpjq/perplexica-auth/resolve/main/src/lib/serverUtils.ts
238 Bytes
| import crypto from 'crypto'; | |
| export const hashObj = (obj: { [key: string]: any }) => { | |
| const json = JSON.stringify(obj, Object.keys(obj).sort()); | |
| const hash = crypto.createHash('sha256').update(json).digest('hex'); | |
| return hash; | |
| }; | |