web3-proxy/web3_proxy/src/users.rs
2022-08-05 19:22:23 +00:00

12 lines
231 B
Rust

use rand::prelude::*;
use uuid::{Builder, Uuid};
pub fn new_api_key() -> Uuid {
// TODO: chacha20?
let mut rng = thread_rng();
let random_bytes = rng.gen();
Builder::from_random_bytes(random_bytes).into_uuid()
}