md5.go 294 B

123456789101112131415161718
  1. package utils
  2. import (
  3. "crypto/md5"
  4. "encoding/hex"
  5. )
  6. //@author: [piexlmax](https://github.com/piexlmax)
  7. //@function: MD5V
  8. //@description: md5加密
  9. //@param: str []byte
  10. //@return: string
  11. func MD5V(str []byte) string {
  12. h := md5.New()
  13. h.Write(str)
  14. return hex.EncodeToString(h.Sum(nil))
  15. }