mirror of
https://github.com/wukko/cobalt.git
synced 2024-11-16 21:29:58 +00:00
11 lines
308 B
JavaScript
11 lines
308 B
JavaScript
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();
|
|
} |