Small temp redis-based pastebin 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.
 
 
 

19 lines
317 B

package main
import (
"math/rand"
)
const KeyID = "abcdefghjkmnpqrstuvwxyzABCDEFGHJKMNPQRSTUVWXYZ23456789-_+$~"
func RandomString(length int) string {
b := make([]uint8, length)
for i := range b {
b[i] = KeyID[rand.Intn(len(KeyID))]
}
return string(b)
}
func GetNewKey() string {
return RandomString(6)
}