refactor: replace static with const for global constants (#5260)

Co-authored-by: Daniel García <dani-garcia@users.noreply.github.com>
This commit is contained in:
Integral
2025-01-11 04:06:38 +08:00
committed by GitHub
parent ca7483df85
commit 327d369188
2 changed files with 3 additions and 3 deletions

View File

@@ -6,7 +6,7 @@ use std::num::NonZeroU32;
use data_encoding::{Encoding, HEXLOWER};
use ring::{digest, hmac, pbkdf2};
static DIGEST_ALG: pbkdf2::Algorithm = pbkdf2::PBKDF2_HMAC_SHA256;
const DIGEST_ALG: pbkdf2::Algorithm = pbkdf2::PBKDF2_HMAC_SHA256;
const OUTPUT_LEN: usize = digest::SHA256_OUTPUT_LEN;
pub fn hash_password(secret: &[u8], salt: &[u8], iterations: u32) -> Vec<u8> {