15 lines
301 B
Go
15 lines
301 B
Go
|
package main
|
||
|
|
||
|
import "math/rand"
|
||
|
|
||
|
func generateUrl() string {
|
||
|
length := currentConfig.urlLength
|
||
|
listChars := []rune("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789")
|
||
|
b := make([]rune, length)
|
||
|
for i := range b {
|
||
|
b[i] = listChars[rand.Intn(len(listChars))]
|
||
|
}
|
||
|
|
||
|
return string(b)
|
||
|
}
|