hash.go 197 B

12345678910111213
  1. package utils
  2. import (
  3. "crypto/sha256"
  4. "fmt"
  5. "strings"
  6. )
  7. func SimpleHash(s ...string) string {
  8. str := strings.Join(s, "-")
  9. sum := sha256.Sum256([]byte(str))
  10. return fmt.Sprintf("%x", sum)
  11. }