summaryrefslogtreecommitdiffstats
path: root/tests/util.rs
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2015-04-06 02:29:46 -0400
committerJesse Luehrs <doy@tozt.net>2015-04-06 02:29:46 -0400
commit22416261173457f261328d5f347f04a93e493bf5 (patch)
treea861bb8a25a0a8a53b1d7c3c1851733418fffc39 /tests/util.rs
parent2445f1468ec8176e9f36768cb11bc94466b5e671 (diff)
downloadmatasano-22416261173457f261328d5f347f04a93e493bf5.tar.gz
matasano-22416261173457f261328d5f347f04a93e493bf5.zip
factor out another utility function
Diffstat (limited to 'tests/util.rs')
-rw-r--r--tests/util.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/util.rs b/tests/util.rs
index bb41fb6..46ca46c 100644
--- a/tests/util.rs
+++ b/tests/util.rs
@@ -2,6 +2,7 @@
extern crate rand;
extern crate rustc_serialize as serialize;
+extern crate time;
use std::io::prelude::*;
use std::fs::File;
@@ -57,3 +58,7 @@ pub fn random_aes_128_key () -> [u8; 16] {
pub fn coinflip () -> bool {
self::rand::thread_rng().gen()
}
+
+pub fn now () -> u32 {
+ return self::time::now().to_timespec().sec as u32;
+}