hugobot/utils/shortid.go

26 lines
289 B
Go
Raw Normal View History

2019-04-10 13:13:33 +00:00
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)
}
}