pastebin/common/random.go

14 lines
200 B
Go
Raw Normal View History

2023-09-30 13:47:59 +00:00
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
}