crypto: Add backward compatible aliases for Sha3{,Hash}()

This commit is contained in:
Ricardo Catalinas Jiménez 2016-02-21 22:45:08 +00:00
parent 436fc8d76a
commit 0c6665558a

View File

@ -60,6 +60,10 @@ func Keccak256Hash(data ...[]byte) (h common.Hash) {
return h
}
// Deprecated: For backward compatibility as other packages depend on these
func Sha3(data ...[]byte) []byte { return Keccak256(data...) }
func Sha3Hash(data ...[]byte) common.Hash { return Keccak256Hash(data...) }
// Creates an ethereum address given the bytes and the nonce
func CreateAddress(b common.Address, nonce uint64) common.Address {
data, _ := rlp.EncodeToBytes([]interface{}{b, nonce})