Files
Perplexica/src/lib/serverUtils.ts
2025-10-11 17:59:45 +05:30

8 lines
238 B
TypeScript

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;
};