misc: added credential hash

This commit is contained in:
Sheen Capadngan
2025-01-28 22:37:27 +08:00
parent 317c95384e
commit 23f605bda7
4 changed files with 8 additions and 2 deletions
+1 -1
View File
@@ -116,7 +116,7 @@ export const decryptAsymmetric = ({ ciphertext, nonce, publicKey, privateKey }:
export const generateSymmetricKey = (size = 32) => crypto.randomBytes(size).toString("base64");
export const generateHash = (value: string) => crypto.createHash("sha256").update(value).digest("hex");
export const generateHash = (value: string | Buffer) => crypto.createHash("sha256").update(value).digest("hex");
export const generateAsymmetricKeyPair = () => {
const pair = nacl.box.keyPair();