api: clean up imports & consts

This commit is contained in:
wukko
2024-05-16 14:20:40 +06:00
parent 592bfe24cf
commit b5c81084c8
2 changed files with 34 additions and 28 deletions

View File

@ -1,6 +1,10 @@
import { createHmac, createCipheriv, createDecipheriv } from "crypto";
import { createHmac, createCipheriv, createDecipheriv, randomBytes } from "crypto";
const algorithm = "aes256"
const algorithm = "aes256";
export function generateSalt() {
return randomBytes(64).toString('hex');
}
export function generateHmac(str, salt) {
return createHmac("sha256", salt).update(str).digest("base64url");