gosec

This commit is contained in:
naiba
2021-09-04 12:42:51 +08:00
parent 67faa7a63d
commit e40026f6cc
8 changed files with 13 additions and 14 deletions

View File

@@ -1,7 +1,7 @@
package utils
import (
"crypto/md5"
"crypto/md5" // #nosec
"encoding/hex"
"math/rand"
"os"
@@ -34,11 +34,11 @@ func RandStringBytesMaskImprSrcUnsafe(n int) string {
remain--
}
return *(*string)(unsafe.Pointer(&b))
return *(*string)(unsafe.Pointer(&b)) //#nosec
}
func MD5(plantext string) string {
hash := md5.New()
hash := md5.New() // #nosec
hash.Write([]byte(plantext))
return hex.EncodeToString(hash.Sum(nil))
}