| 123456789101112131415161718192021222324252627 | 
							- package tools
 
- import (
 
- 	"crypto/md5"
 
- 	"encoding/hex"
 
- 	"fmt"
 
- 	"io"
 
- 	"strings"
 
- )
 
- func MD5(sourceValue string) string {
 
- 	w := md5.New()
 
- 	io.WriteString(w, sourceValue)
 
- 	newMD5 := fmt.Sprintf("%x", w.Sum(nil))
 
- 	
 
- 	return strings.ToUpper(newMD5)
 
- }
 
- func GetMD5Encode(data string) string {
 
- 	h := md5.New()
 
- 	h.Write([]byte(data))
 
- 	return hex.EncodeToString(h.Sum(nil))
 
- }
 
 
  |