pastebin/common/random.go
2023-09-30 21:47:59 +08:00

14 lines
200 B
Go

package common
import (
"github.com/sqids/sqids-go"
)
func UniqID(unix int64) string {
s, _ := sqids.New(sqids.Options{
MinLength: 8,
})
id, _ := s.Encode([]uint64{uint64(unix)})
return id
}