mirror of
https://github.com/fluencelabs/tendermint
synced 2025-04-29 00:32:14 +00:00
20 lines
318 B
Go
20 lines
318 B
Go
// nolint: goimports
|
|
package crypto
|
|
|
|
import (
|
|
"crypto/sha256"
|
|
"golang.org/x/crypto/ripemd160"
|
|
)
|
|
|
|
func Sha256(bytes []byte) []byte {
|
|
hasher := sha256.New()
|
|
hasher.Write(bytes)
|
|
return hasher.Sum(nil)
|
|
}
|
|
|
|
func Ripemd160(bytes []byte) []byte {
|
|
hasher := ripemd160.New()
|
|
hasher.Write(bytes)
|
|
return hasher.Sum(nil)
|
|
}
|