MoreThanText proxy server.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
385 B

// morethantext/proxy/genid.go
package proxy
import (
"math/rand"
"time"
)
const idLength = 64
var runeList = []rune("_-0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ")
func init() {
rand.Seed(time.Now().UnixNano())
}
func newID() string {
id := make([]rune, idLength)
for i := range id {
id[i] = runeList[rand.Intn(len(runeList))]
}
return string(id)
}