You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
303 B

  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, b ...byte) string {
  12. h := md5.New()
  13. h.Write(str)
  14. return hex.EncodeToString(h.Sum(b))
  15. }