mirror of
				https://github.com/mickael-kerjean/filestash.git
				synced 2025-10-30 17:46:41 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			20 lines
		
	
	
		
			313 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			20 lines
		
	
	
		
			313 B
		
	
	
	
		
			Go
		
	
	
	
	
	
| package common
 | |
| 
 | |
| import (
 | |
| 	"math/rand"
 | |
| )
 | |
| 
 | |
| var Letters = []rune("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789")
 | |
| 
 | |
| func RandomString(n int) string {
 | |
| 	b := make([]rune, n)
 | |
| 	for i := range b {
 | |
| 		b[i] = Letters[rand.Intn(len(Letters))]
 | |
| 	}
 | |
| 	return string(b)
 | |
| }
 | |
| 
 | |
| func NewBool(t bool) *bool {
 | |
| 	return &t
 | |
| }
 | 
