Add seed-able cryptographic random.

This commit is contained in:
Jae Kwon
2016-03-13 09:40:15 -07:00
parent 76ba23e4c0
commit 264d2a3eef
4 changed files with 119 additions and 1 deletions

18
hash.go Normal file
View File

@@ -0,0 +1,18 @@
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)
}