plakken/utils.go

15 lines
301 B
Go
Raw Normal View History

2023-10-02 20:33:13 +02:00
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)
}