Can create user accounts
This commit is contained in:
		@@ -1,3 +1,4 @@
 | 
			
		||||
pub mod err;
 | 
			
		||||
pub mod time;
 | 
			
		||||
pub mod network_utils;
 | 
			
		||||
pub mod network_utils;
 | 
			
		||||
pub mod string_utils;
 | 
			
		||||
							
								
								
									
										11
									
								
								src/utils/string_utils.rs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								src/utils/string_utils.rs
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,11 @@
 | 
			
		||||
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)
 | 
			
		||||
        .map(char::from)
 | 
			
		||||
        .take(len)
 | 
			
		||||
        .collect()
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user