md5.go 167 B

123456789101112
  1. package utils
  2. import (
  3. "crypto/md5"
  4. "encoding/hex"
  5. )
  6. func MD5(str []byte, b ...byte) string {
  7. h := md5.New()
  8. h.Write(str)
  9. return hex.EncodeToString(h.Sum(b))
  10. }