Generate reset password URL

This commit is contained in:
2023-05-30 15:12:58 +02:00
parent c84c2ef3c5
commit 62a52b385e
10 changed files with 418 additions and 16 deletions

View File

@ -0,0 +1,11 @@
use rand::distributions::Alphanumeric;
use rand::Rng;
/// Generate a random string of a given size
pub fn rand_str(len: usize) -> String {
rand::thread_rng()
.sample_iter(&Alphanumeric)
.map(char::from)
.take(len)
.collect()
}