multipart ranges
This commit is contained in:
parent
37f65b6353
commit
a5ecf145a9
4 changed files with 75 additions and 26 deletions
10
src/lib.rs
10
src/lib.rs
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue