1
0
Fork 0
mirror of https://forgejo.ellis.link/continuwuation/continuwuity.git synced 2025-08-10 15:30:54 +00:00
continuwuity/src/core/utils/hash.rs

16 lines
355 B
Rust
Raw Normal View History

mod argon;
mod sha256;
use crate::Result;
#[inline]
pub fn password(password: &str) -> Result<String> { argon::password(password) }
#[inline]
pub fn verify_password(password: &str, password_hash: &str) -> Result<()> {
argon::verify_password(password, password_hash)
}
#[inline]
pub fn calculate_hash(keys: &[&[u8]]) -> Vec<u8> { sha256::hash(keys) }