Applies perfsprint linter (#24999)
Replacing usages of fmt.Sprint with faster alternatives Signed-off-by: Philippe Antoine <contact@catenacyber.fr>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
43f4734eae
Коммит
04e7b6bc9e
@@ -5,12 +5,12 @@ package utils
|
||||
|
||||
import (
|
||||
"crypto/sha256"
|
||||
"fmt"
|
||||
"encoding/hex"
|
||||
)
|
||||
|
||||
func HashSha256(text string) string {
|
||||
hash := sha256.New()
|
||||
hash.Write([]byte(text))
|
||||
|
||||
return fmt.Sprintf("%x", hash.Sum(nil))
|
||||
return hex.EncodeToString(hash.Sum(nil))
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user