working commit
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
/*
|
||||
* Copyright 2019 Oleg Borodin <borodin@unix7.org>
|
||||
*/
|
||||
|
||||
package auxtool
|
||||
|
||||
import (
|
||||
"math/rand"
|
||||
)
|
||||
|
||||
func RandomString(n int) string {
|
||||
const letters = "1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
|
||||
arr := make([]byte, n)
|
||||
for i := range arr {
|
||||
arr[i] = letters[rand.Intn(len(letters))]
|
||||
}
|
||||
return string(arr)
|
||||
}
|
||||
Reference in New Issue
Block a user