mirror of
https://github.com/ItzCrazyKns/Perplexica.git
synced 2025-10-14 11:38:14 +00:00
8 lines
238 B
TypeScript
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;
|
|
};
|