Updated dependencies

This commit is contained in:
2025-04-07 23:09:56 -04:00
parent ce6d02be34
commit 7f51134066
3 changed files with 271 additions and 132 deletions

View File

@@ -2,6 +2,7 @@ use argon2::{
password_hash::{rand_core::OsRng, SaltString},
Argon2, PasswordHash, PasswordHasher, PasswordVerifier,
};
use rand::distr::Alphanumeric;
use rand::prelude::*;
use rand_chacha::ChaCha20Rng;
use serde::{Deserialize, Serialize};
@@ -18,9 +19,9 @@ use crate::error::{Error, ApiResult};
pub fn csprng(take: usize) -> String {
// Generate a CSPRNG 128-bit (16 byte) ID using alphanumeric characters (a-z, A-Z, 0-9)
let rng = ChaCha20Rng::from_entropy();
let rng = ChaCha20Rng::from_os_rng();
rng
.sample_iter(rand::distributions::Alphanumeric)
.sample_iter(Alphanumeric)
.take(take)
.map(char::from)
.collect()