From 94dd68606b74cd869399d1267d33659afd5dd1a8 Mon Sep 17 00:00:00 2001 From: Niko Date: Mon, 12 Jun 2023 23:51:57 +0300 Subject: [PATCH] example password gen --- ng-wallet/src/lib.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/ng-wallet/src/lib.rs b/ng-wallet/src/lib.rs index 6ff7ffa..b7f34f8 100644 --- a/ng-wallet/src/lib.rs +++ b/ng-wallet/src/lib.rs @@ -314,6 +314,19 @@ pub fn gen_shuffle_for_pin() -> Vec { digits } +// fn random_pass() { +// const choices: &str = +// "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()"; + +// let mut ran = thread_rng(); + +// let mut mnemonic: [char; 11] = [0.into(); 11]; +// for i in &mut mnemonic { +// *i = choices.chars().nth(ran.gen_range(0, 72)).unwrap(); +// } +// log!("{}", mnemonic.iter().collect::()); +// } + /// creates a Wallet from a pin, a security text and image (with option to send the bootstrap and wallet to nextgraph.one) /// and returns the Wallet, the pazzle and the mnemonic pub async fn create_wallet_v0( @@ -548,6 +561,11 @@ mod tests { use std::io::Write; use std::time::Instant; + // #[test] + // fn random_pass() { + // super::random_pass() + // } + #[test] fn test_gen_shuffle() { let shuffle = gen_shuffle_for_pazzle_opening(9);