pub fn new_random<R, S>(
rng: &mut R,
password: S,
) -> Result<(KeyStore, Vec<u8>), KeyStoreError>Expand description
Creates a new keystore using a random 32 byte secret and the Scrypt key derivation function.
The keystore is encrypted by a key derived from the provided password.
ยงExample
use web3_keystore::new_random;
let mut rng = rand::thread_rng();
let password = "super-secret-password";
let (keystore, secret) = new_random(&mut rng, password).unwrap();
assert_eq!(32, secret.len());