mirror of
https://github.com/LBRYFoundation/lbcutil.git
synced 2025-08-23 17:47:30 +00:00
Use fastsha256 in Hash160.
Rather than using the stdlib sha256, use the Conformal fastsha256 package for faster hashing.
This commit is contained in:
parent
58bae71f61
commit
fdb279f482
1 changed files with 2 additions and 2 deletions
|
@ -6,7 +6,7 @@ package btcutil
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"code.google.com/p/go.crypto/ripemd160"
|
"code.google.com/p/go.crypto/ripemd160"
|
||||||
"crypto/sha256"
|
"github.com/conformal/fastsha256"
|
||||||
"hash"
|
"hash"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -18,5 +18,5 @@ func calcHash(buf []byte, hasher hash.Hash) []byte {
|
||||||
|
|
||||||
// Hash160 calculates the hash ripemd160(sha256(b)).
|
// Hash160 calculates the hash ripemd160(sha256(b)).
|
||||||
func Hash160(buf []byte) []byte {
|
func Hash160(buf []byte) []byte {
|
||||||
return calcHash(calcHash(buf, sha256.New()), ripemd160.New())
|
return calcHash(calcHash(buf, fastsha256.New()), ripemd160.New())
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue