1 2 3 4 5 6 7 8 9 10 11 12 13 14
use rand; pub trait NonceGenerator { fn get(&self) -> u64; } #[derive(Default)] pub struct RandomNonce; impl NonceGenerator for RandomNonce { fn get(&self) -> u64 { rand::random() } }
1 2 3 4 5 6 7 8 9 10 11 12 13 14
use rand; pub trait NonceGenerator { fn get(&self) -> u64; } #[derive(Default)] pub struct RandomNonce; impl NonceGenerator for RandomNonce { fn get(&self) -> u64 { rand::random() } }