multipart ranges

This commit is contained in:
JMARyA 2025-01-13 19:00:44 +01:00
parent 37f65b6353
commit a5ecf145a9
Signed by: jmarya
GPG key ID: 901B2ADDF27C2263
4 changed files with 75 additions and 26 deletions

View file

@ -1,3 +1,5 @@
use data_encoding::HEXUPPER;
use rand::RngCore;
use tokio::sync::OnceCell;
pub mod auth;
@ -41,3 +43,11 @@ macro_rules! get_pg {
}
};
}
pub fn gen_random(token_length: usize) -> String {
let mut token_bytes = vec![0u8; token_length];
rand::thread_rng().fill_bytes(&mut token_bytes);
HEXUPPER.encode(&token_bytes)
}