OSDN Git Service

new repo
[bytom/vapor.git] / vendor / github.com / tendermint / go-crypto / hash.go
1 package crypto
2
3 import (
4         "crypto/sha256"
5         "golang.org/x/crypto/ripemd160"
6 )
7
8 func Sha256(bytes []byte) []byte {
9         hasher := sha256.New()
10         hasher.Write(bytes)
11         return hasher.Sum(nil)
12 }
13
14 func Ripemd160(bytes []byte) []byte {
15         hasher := ripemd160.New()
16         hasher.Write(bytes)
17         return hasher.Sum(nil)
18 }