use pbkdf2::{Algorithm, Params, PasswordHasher, Pbkdf2};
use crate::internal::secrets::InternalError;
pub const DEFAULT_ROUNDS: u32 = Params::RECOMMENDED_ROUNDS;
pub const MIN_ROUNDS: u32 = Params::MIN_ROUNDS;
pub const MAX_ROUNDS: u32 = u32::MAX;
pub fn generate_pbkdf2(password: &[u8], rounds: u32) -> Result<String, InternalError> {
let pbkdf2 = Pbkdf2::new(Algorithm::RECOMMENDED, Params::new(rounds)?);
Ok(pbkdf2.hash_password(password)?.to_string())
}