Files
go-gin-api/pkg/hash/hash_hashids_test.go
2021-03-28 15:52:02 +08:00

19 lines
330 B
Go

package hash
import "testing"
const secret = "i1ydX9RtHyuJTrw7frcu"
const length = 12
func TestHashidsEncode(t *testing.T) {
str, _ := New(secret, length).HashidsEncode([]int{99})
t.Log(str)
//GyV5pJqXvwAR
}
func TestHashidsDecode(t *testing.T) {
ids, _ := New(secret, length).HashidsDecode("GyV5pJqXvwAR")
t.Log(ids)
}