1 Star 1 Fork 0

vincent/gcutil

Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
Clone or Download
token.go 393 Bytes
Copy Edit Raw Blame History
vincent authored 2020-06-28 15:53 . 添加部分之前存在的utils
package token
import (
"crypto/md5"
"crypto/rand"
"encoding/base64"
"encoding/hex"
"io"
)
func GetMd5String(s string) string {
h := md5.New()
h.Write([]byte(s))
return hex.EncodeToString(h.Sum(nil))
}
func UniqueId() string {
b := make([]byte, 48)
if _, err := io.ReadFull(rand.Reader, b); err != nil {
return ""
}
return GetMd5String(base64.URLEncoding.EncodeToString(b))
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/vincent78/gcutil.git
git@gitee.com:vincent78/gcutil.git
vincent78
gcutil
gcutil
v1.0.1

Search