Files
continuwuity/src/core/utils/hash.rs
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

14 lines
337 B
Rust
Raw Normal View History

2024-07-03 00:44:00 +00:00
mod argon;
mod sha256;
2024-06-04 23:51:02 +00:00
2024-07-03 00:44:00 +00:00
use crate::Result;
2024-06-04 23:51:02 +00:00
2024-07-03 00:44:00 +00:00
pub fn password(password: &str) -> Result<String> { argon::password(password) }
2024-06-04 23:51:02 +00:00
2024-07-03 00:44:00 +00:00
pub fn verify_password(password: &str, password_hash: &str) -> Result<()> {
argon::verify_password(password, password_hash)
2024-06-04 23:51:02 +00:00
}
2024-07-03 00:54:36 +00:00
#[must_use]
2024-07-03 00:44:00 +00:00
pub fn calculate_hash(keys: &[&[u8]]) -> Vec<u8> { sha256::hash(keys) }