Files
certd/packages/core/basic/src/utils/util.hash.ts
T
2024-12-22 14:00:46 +08:00

13 lines
269 B
TypeScript

import crypto from 'crypto';
function md5(data: string) {
return crypto.createHash('md5').update(data).digest('hex');
}
function sha256(data: string) {
return crypto.createHash('sha256').update(data).digest('hex');
}
export const hashUtils = {
md5,
sha256,
};