change rng to OsRng, version bump

This commit is contained in:
Ondřej Hruška
2020-02-09 21:51:16 +01:00
parent 4046e7f185
commit 89bebc6b03
3 changed files with 11 additions and 4 deletions
+2 -2
View File
@@ -1,5 +1,5 @@
use parking_lot::{Mutex, RwLock, RwLockUpgradableReadGuard};
use rand::Rng;
use rand::{Rng, rngs::OsRng};
use rocket::{
fairing::{self, Fairing, Info},
@@ -176,7 +176,7 @@ where
// Find a new unique ID - we are still safely inside the write guard
let new_id = SessionID(loop {
let token: String = rand::thread_rng()
let token: String = OsRng
.sample_iter(&rand::distributions::Alphanumeric)
.take(store.config.cookie_len)
.collect();