use fastsha256
This commit is contained in:
parent
dd41f7e91a
commit
6ad853019a
1 changed files with 2 additions and 2 deletions
|
@ -6,9 +6,9 @@ package btcwire
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"crypto/rand"
|
"crypto/rand"
|
||||||
"crypto/sha256"
|
|
||||||
"encoding/binary"
|
"encoding/binary"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"github.com/conformal/fastsha256"
|
||||||
"io"
|
"io"
|
||||||
"math"
|
"math"
|
||||||
)
|
)
|
||||||
|
@ -414,7 +414,7 @@ func RandomUint64() (uint64, error) {
|
||||||
|
|
||||||
// DoubleSha256 calculates sha256(sha256(b)) and returns the resulting bytes.
|
// DoubleSha256 calculates sha256(sha256(b)) and returns the resulting bytes.
|
||||||
func DoubleSha256(b []byte) []byte {
|
func DoubleSha256(b []byte) []byte {
|
||||||
hasher := sha256.New()
|
hasher := fastsha256.New()
|
||||||
hasher.Write(b)
|
hasher.Write(b)
|
||||||
sum := hasher.Sum(nil)
|
sum := hasher.Sum(nil)
|
||||||
hasher.Reset()
|
hasher.Reset()
|
||||||
|
|
Loading…
Add table
Reference in a new issue