dls: add password hash function

This commit is contained in:
Mikaël Cluseau
2026-03-16 11:06:19 +01:00
parent 4b1edb2a55
commit 4619899e65
6 changed files with 216 additions and 647 deletions

View File

@@ -83,6 +83,11 @@ impl Config {
}
pub fn base64_decode(s: &str) -> Result<Vec<u8>, base64::DecodeError> {
use base64::{Engine, prelude::BASE64_STANDARD_NO_PAD as B64};
use base64::{prelude::BASE64_STANDARD_NO_PAD as B64, Engine as _};
B64.decode(s.trim_end_matches('='))
}
pub fn base64_encode(b: &[u8]) -> String {
use base64::{prelude::BASE64_STANDARD as B64, Engine as _};
B64.encode(b)
}