广告平台(站长使用)
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

crypto.go 296 B

il y a 1 mois
12345678910111213141516171819
  1. package utils
  2. import (
  3. "crypto/md5"
  4. "encoding/base64"
  5. "fmt"
  6. )
  7. func GetMd5(raw []byte) string {
  8. h := md5.New()
  9. h.Write(raw)
  10. return fmt.Sprintf("%x", h.Sum(nil))
  11. }
  12. func GetBase64Md5(raw []byte) string {
  13. h := md5.New()
  14. h.Write(raw)
  15. return base64.StdEncoding.EncodeToString(h.Sum(nil))
  16. }