Make Ripemd160 the default

This commit is contained in:
Jae Kwon
2015-07-10 12:15:46 -07:00
parent 41845d5b85
commit 2e1d8ba054
10 changed files with 26 additions and 32 deletions

View File

@ -40,6 +40,7 @@ func BinaryCompare(a, b interface{}) int {
return bytes.Compare(aBytes, bBytes)
}
// NOTE: only use this if you need 32 bytes.
func BinarySha256(o interface{}) []byte {
hasher, n, err := sha256.New(), new(int64), new(error)
WriteBinary(o, hasher, n, err)
@ -49,6 +50,7 @@ func BinarySha256(o interface{}) []byte {
return hasher.Sum(nil)
}
// NOTE: The default hash function is Ripemd160.
func BinaryRipemd160(o interface{}) []byte {
hasher, n, err := ripemd160.New(), new(int64), new(error)
WriteBinary(o, hasher, n, err)