add comment for more code clarity

This commit is contained in:
einhornimmond 2025-01-09 12:27:46 +01:00
parent 8517b89fb0
commit 4d383a4346

View File

@ -5,7 +5,7 @@ import { getUserCryptographicSalt, SecretKeyCryptographyCreateKey } from './Encr
export const encryptPassword = async (dbUser: User, password: string): Promise<bigint> => {
const salt = getUserCryptographicSalt(dbUser)
const keyBuffer = await SecretKeyCryptographyCreateKey(salt, password) // return short and long hash
const keyBuffer: Uint8Array[] = await SecretKeyCryptographyCreateKey(salt, password) // returns Uint8Array[short hash, long hash]
const passwordHash = Buffer.from(keyBuffer[0]).readBigUInt64LE()
return passwordHash
}