Issue tokens to initialize VNC connections
This commit is contained in:
12
virtweb_backend/src/utils/rand_utils.rs
Normal file
12
virtweb_backend/src/utils/rand_utils.rs
Normal file
@ -0,0 +1,12 @@
|
||||
use rand::distributions::Alphanumeric;
|
||||
use rand::Rng;
|
||||
|
||||
/// Generate a random string
|
||||
pub fn rand_str(len: usize) -> String {
|
||||
let s: String = rand::thread_rng()
|
||||
.sample_iter(&Alphanumeric)
|
||||
.take(len)
|
||||
.map(char::from)
|
||||
.collect();
|
||||
s
|
||||
}
|
Reference in New Issue
Block a user