feat(app): add serverUtils, create hashObj util

This commit is contained in:
ItzCrazyKns
2025-10-11 17:59:45 +05:30
parent f39638fe02
commit f1e6aa9c1a

7
src/lib/serverUtils.ts Normal file
View File

@@ -0,0 +1,7 @@
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;
};