mirror of
				https://github.com/AppFlowy-IO/AppFlowy.git
				synced 2025-10-31 18:15:09 +00:00 
			
		
		
		
	 b64da2c02f
			
		
	
	
		b64da2c02f
		
			
		
	
	
	
	
		
			
			* chore: rename service * refactor: upload * chore: save upload meta data * chore: add sql test * chore: uploader * chore: fix upload * chore: cache file and remove after finish * chore: retry upload * chore: pause when netowork unreachable * chore: add event test * chore: add test * chore: clippy * chore: update client-api commit id * chore: fix flutter test
		
			
				
	
	
		
			26 lines
		
	
	
		
			529 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
			
		
		
	
	
			26 lines
		
	
	
		
			529 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
| mod local_test;
 | |
| 
 | |
| mod af_cloud_test;
 | |
| // #[cfg(feature = "supabase_cloud_test")]
 | |
| // mod supabase_test;
 | |
| 
 | |
| use rand::{distributions::Alphanumeric, thread_rng, Rng};
 | |
| 
 | |
| pub fn generate_random_string(len: usize) -> String {
 | |
|   let rng = rand::thread_rng();
 | |
|   rng
 | |
|     .sample_iter(&Alphanumeric)
 | |
|     .take(len)
 | |
|     .map(char::from)
 | |
|     .collect()
 | |
| }
 | |
| 
 | |
| 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()
 | |
| }
 |