eod commit

This commit is contained in:
2025-11-25 22:10:36 +01:00
parent 547d133add
commit 3148affe4c
2 changed files with 16 additions and 1 deletions

16
app/src/database/db.v Normal file
View File

@@ -0,0 +1,16 @@
module database
import fleximus.argon2
import rand
pub struct Crypto {}
pub fn Crypto.hash_password(password string) !string {
salt := rand.bytes(16) or { return error('failed to generate salt: ${err}') }
hash := argon2.hash(password.bytes(), salt) or { return error('argon2 hash failed: ${err}') }
return hash
}
pub fn Crypto.hash_verify(password string, hash string) !bool {
return argon2.verify(hash, password.bytes()) or { return error('argon2 verify failed: ${err}') }
}

View File

@@ -3,7 +3,6 @@ module main
import os
import veb
import util
// import app.src.util // IDE display version
//