Replacing usages of fmt.Sprint with faster alternatives

Signed-off-by: Philippe Antoine <contact@catenacyber.fr>
Этот коммит содержится в:
Catena cyber
2023-11-03 11:18:18 +01:00
коммит произвёл GitHub
родитель 43f4734eae
Коммит 04e7b6bc9e
8 изменённых файлов: 21 добавлений и 19 удалений

Просмотреть файл

@@ -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))
}