example1/example1.rs
1use argon2_rs::Argon2;
2
3fn main() {
4 let m_cost = 512_000;
5 let t_cost = 8;
6 let p_cost = 1;
7
8 let argon2 = Argon2::new(m_cost, t_cost, p_cost);
9 let salt = vec![1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16];
10
11 let time = std::time::Instant::now();
12 let hash = argon2.hash_password("password", salt).unwrap();
13 println!("Hash: {:?}", hash);
14 println!("Time to compute: {}secs", time.elapsed().as_secs_f32());
15}