14 lines
200 B
Go
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
|
||
|
}
|