hash: avoid allocation in RipeMD160 calculation

This commit is contained in:
Roman Khimov 2021-12-02 16:11:09 +03:00
parent 53cfde62de
commit 41ab7a85a7

View file

@ -53,7 +53,7 @@ func RipeMD160(data []byte) util.Uint160 {
hasher := ripemd160.New() hasher := ripemd160.New()
_, _ = hasher.Write(data) _, _ = hasher.Write(data)
hash, _ = util.Uint160DecodeBytesBE(hasher.Sum(nil)) hasher.Sum(hash[:0])
return hash return hash
} }