Files
go-gin-api/pkg/hash/hash.go
T
2021-06-12 16:19:29 +08:00

28 lines
382 B
Go

package hash
var _ Hash = (*hash)(nil)
type Hash interface {
i()
// HashidsEncode 加密
HashidsEncode(params []int) (string, error)
// HashidsDecode 解密
HashidsDecode(hash string) ([]int, error)
}
type hash struct {
secret string
length int
}
func New(secret string, length int) Hash {
return &hash{
secret: secret,
length: length,
}
}
func (h *hash) i() {}