hash.go 343 B

12345678910111213141516171819202122232425
  1. package hash
  2. var _ Hash = (*hash)(nil)
  3. type Hash interface {
  4. i()
  5. // hashids
  6. HashidsEncode(params []int) (string, error)
  7. HashidsDecode(hash string) ([]int, error)
  8. }
  9. type hash struct {
  10. secret string
  11. length int
  12. }
  13. func New(secret string, length int) Hash {
  14. return &hash{
  15. secret: secret,
  16. length: length,
  17. }
  18. }
  19. func (h *hash) i() {}