mirror of
				https://github.com/bestnite/sub2clash.git
				synced 2025-11-03 20:30:35 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			14 lines
		
	
	
		
			296 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			14 lines
		
	
	
		
			296 B
		
	
	
	
		
			Go
		
	
	
	
	
	
package common
 | 
						|
 | 
						|
import "math/rand"
 | 
						|
 | 
						|
func RandomString(length int) string {
 | 
						|
 | 
						|
	const charset = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
 | 
						|
	var result []byte
 | 
						|
	for i := 0; i < length; i++ {
 | 
						|
		result = append(result, charset[rand.Intn(len(charset))])
 | 
						|
	}
 | 
						|
	return string(result)
 | 
						|
}
 |