4 "github.com/vapor/common"
5 "golang.org/x/crypto/ripemd160"
6 "golang.org/x/crypto/sha3"
9 func DoubleSha256(b []byte) []byte {
10 hasher := sha3.New256()
12 sum := hasher.Sum(nil)
15 return hasher.Sum(nil)
18 func Sha256(data ...[]byte) []byte {
20 for _, b := range data {
26 func Sha256Hash(data ...[]byte) (h common.Hash) {
28 for _, b := range data {
35 func Sha3(data ...[]byte) []byte { return Sha256(data...) }
36 func Sha3Hash(data ...[]byte) common.Hash { return Sha256Hash(data...) }
38 func Ripemd160(data []byte) []byte {
39 ripemd := ripemd160.New()
42 return ripemd.Sum(nil)