Fixed renamed function after upgrading rand_chacha and rand

This commit is contained in:
Thorsten Sommer 2025-02-09 17:59:55 +01:00
parent d4f135e0e1
commit 6da4cf1425
Signed by: tsommer
GPG Key ID: 371BBA77A02C0108
2 changed files with 2 additions and 2 deletions

View File

@ -8,7 +8,7 @@ use rocket::request::FromRequest;
/// The API token used to authenticate requests.
pub static API_TOKEN: Lazy<APIToken> = Lazy::new(|| {
let mut token = [0u8; 32];
let mut rng = rand_chacha::ChaChaRng::from_entropy();
let mut rng = rand_chacha::ChaChaRng::from_os_rng();
rng.fill_bytes(&mut token);
let token = APIToken::from_bytes(token.to_vec());

View File

@ -32,7 +32,7 @@ pub static ENCRYPTION: Lazy<Encryption> = Lazy::new(|| {
// We use a cryptographically secure pseudo-random number generator
// to generate the secret password & salt. ChaCha20Rng is the algorithm
// of our choice:
let mut rng = rand_chacha::ChaChaRng::from_entropy();
let mut rng = rand_chacha::ChaChaRng::from_os_rng();
// Fill the secret key & salt with random bytes:
rng.fill_bytes(&mut secret_key);