2024 edition
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
use crate::entity::account::Account;
|
||||
use chacha20poly1305::{AeadCore, AeadInPlace, ChaCha20Poly1305, KeyInit};
|
||||
use pbkdf2::pbkdf2_hmac_array;
|
||||
use rand::{rngs::OsRng, RngCore};
|
||||
use rand::{RngCore, rngs::OsRng};
|
||||
use sha2::Sha256;
|
||||
|
||||
pub struct Cipher {
|
||||
|
@@ -1,6 +1,6 @@
|
||||
use crate::entity::master_pass::MasterPass;
|
||||
use rand::{rngs::OsRng, RngCore};
|
||||
use scrypt::{scrypt, Params};
|
||||
use rand::{RngCore, rngs::OsRng};
|
||||
use scrypt::{Params, scrypt};
|
||||
use std::sync::LazyLock;
|
||||
use subtle::ConstantTimeEq;
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
use arrayvec::ArrayString;
|
||||
use rand::{seq::SliceRandom, thread_rng, CryptoRng, Rng};
|
||||
use rand::{CryptoRng, Rng, seq::SliceRandom, thread_rng};
|
||||
use std::array;
|
||||
|
||||
const CHARS: &[u8] = br##"!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_abcdefghijklmnopqrstuvwxyz{|}~"##;
|
||||
@@ -60,8 +60,8 @@ where
|
||||
|
||||
#[must_use]
|
||||
#[allow(clippy::module_name_repetitions)]
|
||||
pub fn generate_passwords<const AMOUNT: usize, const LENGTH: usize>(
|
||||
) -> [ArrayString<LENGTH>; AMOUNT] {
|
||||
pub fn generate_passwords<const AMOUNT: usize, const LENGTH: usize>()
|
||||
-> [ArrayString<LENGTH>; AMOUNT] {
|
||||
let mut rng = thread_rng();
|
||||
array::from_fn(|_| generate_password(&mut rng))
|
||||
}
|
||||
|
Reference in New Issue
Block a user