perf(lib): iterate s.policy.Bots by index to drop per-call heap copy (#1639)

Signed-off-by: jvoisin <julien.voisin@dustri.org>
This commit is contained in:
Julien Voisin
2026-05-28 17:35:14 +02:00
committed by GitHub
parent 63d517c34d
commit 04b3a835cd
5 changed files with 22 additions and 9 deletions
+2 -3
View File
@@ -11,9 +11,8 @@ import (
// SHA256sum computes a cryptographic hash. Still used for proof-of-work challenges
// where we need the security properties of a cryptographic hash function.
func SHA256sum(text string) string {
hash := sha256.New()
hash.Write([]byte(text))
return hex.EncodeToString(hash.Sum(nil))
sum := sha256.Sum256([]byte(text))
return hex.EncodeToString(sum[:])
}
// FastHash is a high-performance non-cryptographic hash function suitable for