aboutsummaryrefslogtreecommitdiffstats
path: root/crypto
diff options
context:
space:
mode:
authorRicardo Catalinas Jiménez <r@untroubled.be>2016-02-22 06:45:08 +0800
committerRicardo Catalinas Jiménez <r@untroubled.be>2016-02-22 06:46:31 +0800
commit0c6665558a122bd7485fd4548801da54c520d7aa (patch)
treed6d4e481cea75d28aaff5a9f31bf77bd11d24680 /crypto
parent436fc8d76a4871d67a61dc86c1a635e20594a0e6 (diff)
downloaddexon-0c6665558a122bd7485fd4548801da54c520d7aa.tar
dexon-0c6665558a122bd7485fd4548801da54c520d7aa.tar.gz
dexon-0c6665558a122bd7485fd4548801da54c520d7aa.tar.bz2
dexon-0c6665558a122bd7485fd4548801da54c520d7aa.tar.lz
dexon-0c6665558a122bd7485fd4548801da54c520d7aa.tar.xz
dexon-0c6665558a122bd7485fd4548801da54c520d7aa.tar.zst
dexon-0c6665558a122bd7485fd4548801da54c520d7aa.zip
crypto: Add backward compatible aliases for Sha3{,Hash}()
Diffstat (limited to 'crypto')
-rw-r--r--crypto/crypto.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/crypto/crypto.go b/crypto/crypto.go
index f8e03acc5..a947d84d2 100644
--- a/crypto/crypto.go
+++ b/crypto/crypto.go
@@ -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})