浏览代码

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

Ricardo Catalinas Jiménez 9 年之前
父节点
当前提交
0c6665558a
共有 1 个文件被更改,包括 4 次插入0 次删除
  1. 4 0
      crypto/crypto.go

+ 4 - 0
crypto/crypto.go

@@ -60,6 +60,10 @@ func Keccak256Hash(data ...[]byte) (h common.Hash) {
 	return h
 	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
 // Creates an ethereum address given the bytes and the nonce
 func CreateAddress(b common.Address, nonce uint64) common.Address {
 func CreateAddress(b common.Address, nonce uint64) common.Address {
 	data, _ := rlp.EncodeToBytes([]interface{}{b, nonce})
 	data, _ := rlp.EncodeToBytes([]interface{}{b, nonce})