Drop fastsha256 in favor of crypto/sha256
This commit is contained in:
parent
96e858f48e
commit
bca6409ade
2 changed files with 4 additions and 4 deletions
|
@ -6,6 +6,7 @@ package coinset_test
|
|||
|
||||
import (
|
||||
"bytes"
|
||||
"crypto/sha256"
|
||||
"encoding/hex"
|
||||
"fmt"
|
||||
"testing"
|
||||
|
@ -14,7 +15,6 @@ import (
|
|||
"github.com/btcsuite/btcd/wire"
|
||||
"github.com/btcsuite/btcutil"
|
||||
"github.com/btcsuite/btcutil/coinset"
|
||||
"github.com/btcsuite/fastsha256"
|
||||
)
|
||||
|
||||
type TestCoin struct {
|
||||
|
@ -32,7 +32,7 @@ func (c *TestCoin) NumConfs() int64 { return c.TxNumConfs }
|
|||
func (c *TestCoin) ValueAge() int64 { return int64(c.TxValue) * c.TxNumConfs }
|
||||
|
||||
func NewCoin(index int64, value btcutil.Amount, numConfs int64) coinset.Coin {
|
||||
h := fastsha256.New()
|
||||
h := sha256.New()
|
||||
h.Write([]byte(fmt.Sprintf("%d", index)))
|
||||
hash, _ := chainhash.NewHash(h.Sum(nil))
|
||||
c := &TestCoin{
|
||||
|
|
|
@ -5,9 +5,9 @@
|
|||
package btcutil
|
||||
|
||||
import (
|
||||
"crypto/sha256"
|
||||
"hash"
|
||||
|
||||
"github.com/btcsuite/fastsha256"
|
||||
"github.com/btcsuite/golangcrypto/ripemd160"
|
||||
)
|
||||
|
||||
|
@ -19,5 +19,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, fastsha256.New()), ripemd160.New())
|
||||
return calcHash(calcHash(buf, sha256.New()), ripemd160.New())
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue