mirror of
https://github.com/certd/certd.git
synced 2026-04-20 17:57:41 +08:00
13 lines
269 B
TypeScript
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,
|
|
};
|