first commit

This commit is contained in:
2024-07-23 10:23:43 +08:00
commit 7b4c2521a3
126 changed files with 15931 additions and 0 deletions

25
pkg/hash/hash.go Normal file
View File

@ -0,0 +1,25 @@
package hash
var _ Hash = (*hash)(nil)
type Hash interface {
i()
// hashids
HashidsEncode(params []int) (string, error)
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() {}