From 41ab7a85a70ef70037ac5ee94f0f7e112ada8c54 Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Thu, 2 Dec 2021 16:11:09 +0300 Subject: [PATCH] hash: avoid allocation in RipeMD160 calculation --- pkg/crypto/hash/hash.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/crypto/hash/hash.go b/pkg/crypto/hash/hash.go index 45f18c7fd..c56600c3c 100644 --- a/pkg/crypto/hash/hash.go +++ b/pkg/crypto/hash/hash.go @@ -53,7 +53,7 @@ func RipeMD160(data []byte) util.Uint160 { hasher := ripemd160.New() _, _ = hasher.Write(data) - hash, _ = util.Uint160DecodeBytesBE(hasher.Sum(nil)) + hasher.Sum(hash[:0]) return hash }