cobalt/modules/sub/crypto.js

11 lines
308 B
JavaScript
Raw Normal View History

2022-07-08 19:17:56 +01:00
import { createHmac, createHash, randomUUID } from "crypto";
export function encrypt(str, salt) {
return createHmac("sha256", salt).update(str).digest("hex");
}
export function md5(string) {
return createHash('md5').update(string).digest('hex');
}
export function UUID() {
return randomUUID();
}