From 3b89dc69da0f88cf8e2290523fa50656ac2ebb5d Mon Sep 17 00:00:00 2001 From: Yves Fischer Date: Mon, 26 Nov 2018 01:35:11 +0100 Subject: Proof of concept with totp --- src/system.rs | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 src/system.rs (limited to 'src/system.rs') diff --git a/src/system.rs b/src/system.rs new file mode 100644 index 0000000..8eba50c --- /dev/null +++ b/src/system.rs @@ -0,0 +1,8 @@ +use std::time; + +pub fn initialize_rng_from_time() { + let r = random::default(); + let now = time::SystemTime::now(); + let nano_secs = now.duration_since(time::SystemTime::UNIX_EPOCH).unwrap().as_nanos(); + r.seed([(nano_secs >> 64) as u64, nano_secs as u64]); +} -- cgit v1.2.1