perplexica-auth / src /lib /serverUtils.ts
pjpjq's picture
Deploy Perplexica to Hugging Face with nginx basic auth
6b6ca97 verified
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;
};