MinioK8sBuckets/src/utils.rs

12 lines
264 B
Rust
Raw Normal View History

2023-05-06 11:15:17 +00:00
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)
.take(len)
.map(char::from)
.collect()
}