mirror of
https://github.com/fluencelabs/tendermint
synced 2025-04-25 14:52:17 +00:00
Currently the top level directory contains basically all of the code for the crypto package. This PR moves the crypto code into submodules in a similar manner to what `golang/x/crypto` does. This improves code organization. Ref discussion: https://github.com/tendermint/tendermint/pull/1966 Closes #1956
20 lines
298 B
Go
20 lines
298 B
Go
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)
|
|
}
|