You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
hugobot/utils/shortid.go

26 lines
289 B
Go

package utils
import (
"github.com/teris-io/shortid"
)
const (
Seed = 322124
)
var (
sid *shortid.Shortid
)
func GetSIDGenerator() *shortid.Shortid {
return sid
}
func init() {
var err error
sid, err = shortid.New(1, shortid.DefaultABC, Seed)
if err != nil {
panic(err)
}
}