Skip to content

Commit 0c66655

Browse files
committed
crypto: Add backward compatible aliases for Sha3{,Hash}()
1 parent 436fc8d commit 0c66655

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

‎crypto/crypto.go‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ func Keccak256Hash(data ...[]byte) (h common.Hash) {
6060
return h
6161
}
6262

63+
// Deprecated: For backward compatibility as other packages depend on these
64+
func Sha3(data ...[]byte) []byte { return Keccak256(data...) }
65+
func Sha3Hash(data ...[]byte) common.Hash { return Keccak256Hash(data...) }
66+
6367
// Creates an ethereum address given the bytes and the nonce
6468
func CreateAddress(b common.Address, nonce uint64) common.Address {
6569
data, _ := rlp.EncodeToBytes([]interface{}{b, nonce})

0 commit comments

Comments
 (0)