mirror of
https://github.com/documenso/documenso.git
synced 2025-11-13 00:03:33 +10:00
13 lines
332 B
TypeScript
13 lines
332 B
TypeScript
import { hashString } from '../auth/hash';
|
|
import { decryptSecondaryData } from './decrypt';
|
|
|
|
export const verify = (data: unknown, signature: string) => {
|
|
const stringified = JSON.stringify(data);
|
|
|
|
const hashed = hashString(stringified);
|
|
|
|
const decrypted = decryptSecondaryData(signature);
|
|
|
|
return decrypted === hashed;
|
|
};
|