Fix rand breaking changes
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing

This commit is contained in:
2025-02-03 20:57:49 +01:00
parent 022073f26a
commit f2e4d82f87
3 changed files with 77 additions and 31 deletions

View File

@ -21,7 +21,7 @@ pub struct TotpKey {
impl TotpKey {
/// Generate a new TOTP key
pub fn new_random() -> Self {
let random_bytes = rand::thread_rng().gen::<[u8; 20]>();
let random_bytes = rand::rng().random::<[u8; 20]>();
Self {
encoded: base32::encode(BASE32_ALPHABET, &random_bytes),
}