Use fastsha256 in Hash160.

Rather than using the stdlib sha256, use the Conformal fastsha256 package
for faster hashing.
This commit is contained in:
Dave Collins 2014-01-04 22:23:01 -06:00
parent 58bae71f61
commit fdb279f482

View file

@ -6,7 +6,7 @@ package btcutil
import (
"code.google.com/p/go.crypto/ripemd160"
"crypto/sha256"
"github.com/conformal/fastsha256"
"hash"
)
@ -18,5 +18,5 @@ func calcHash(buf []byte, hasher hash.Hash) []byte {
// Hash160 calculates the hash ripemd160(sha256(b)).
func Hash160(buf []byte) []byte {
return calcHash(calcHash(buf, sha256.New()), ripemd160.New())
return calcHash(calcHash(buf, fastsha256.New()), ripemd160.New())
}