This commit is contained in:
wanyaoqi
2019-02-14 20:29:24 +08:00
parent b210add54d
commit 3eb7c2900e
10 changed files with 77 additions and 14 deletions

View File

@@ -1,10 +1,18 @@
package stringutils2
import (
"crypto/md5"
"encoding/hex"
"fmt"
"strings"
)
func GetMD5Hash(text string) string {
hasher := md5.New()
hasher.Write([]byte(text))
return hex.EncodeToString(hasher.Sum(nil))
}
func EscapeString(str string, pairs [][]string) string {
if len(pairs) == 0 {
pairs = [][]string{