2023-07-05 12:57:09 +00:00
|
|
|
mod local_test;
|
|
|
|
|
2023-10-02 09:22:22 +00:00
|
|
|
mod af_cloud_test;
|
2024-04-15 06:50:28 +00:00
|
|
|
// #[cfg(feature = "supabase_cloud_test")]
|
|
|
|
// mod supabase_test;
|
2024-01-07 03:12:05 +00:00
|
|
|
|
2024-06-19 23:44:57 +00:00
|
|
|
use rand::{distributions::Alphanumeric, thread_rng, Rng};
|
2024-01-07 03:12:05 +00:00
|
|
|
|
|
|
|
pub fn generate_random_string(len: usize) -> String {
|
|
|
|
let rng = rand::thread_rng();
|
|
|
|
rng
|
|
|
|
.sample_iter(&Alphanumeric)
|
|
|
|
.take(len)
|
|
|
|
.map(char::from)
|
|
|
|
.collect()
|
|
|
|
}
|
2024-06-19 23:44:57 +00:00
|
|
|
|
|
|
|
pub fn generate_random_bytes(size: usize) -> Vec<u8> {
|
|
|
|
let s: String = thread_rng()
|
|
|
|
.sample_iter(&Alphanumeric)
|
|
|
|
.take(size)
|
|
|
|
.map(char::from)
|
|
|
|
.collect();
|
|
|
|
s.into_bytes()
|
|
|
|
}
|