@@ -304,54 +304,6 @@ Cryptographic Hashing
304304 assert(data2 == hex"4e03657aea45a94fc7d47ba826c8d667c0d1e6e33a64a036ec44f58fa12d6c45");
305305
306306
307- .. py :classmethod :: Web3.sha3(primitive = None , hexstr = None , text = None )
308-
309- .. WARNING ::
310- This method has been deprecated for :meth: `~Web3.keccak `
311-
312- Returns the Keccak SHA256 of the given value. Text is encoded to UTF-8 before
313- computing the hash, just like Solidity. Any of the following are
314- valid and equivalent:
315-
316- .. code-block :: python
317-
318- >> > Web3.sha3(0x 747874 )
319- >> > Web3.sha3(b ' \x74\x78\x74 ' )
320- >> > Web3.sha3(hexstr = ' 0x747874' )
321- >> > Web3.sha3(hexstr = ' 747874' )
322- >> > Web3.sha3(text = ' txt' )
323- HexBytes(' 0xd7278090a36507640ea6b7a0034b69b0d240766fa3f98e3722be93c613b29d2e' )
324-
325- .. py :classmethod :: Web3.soliditySha3(abi_types, value)
326-
327- .. WARNING ::
328- This method has been deprecated for :meth: `~Web3.solidityKeccak `
329-
330-
331- Returns the sha3 as it would be computed by the solidity ``sha3 `` function
332- on the provided ``value `` and ``abi_types ``. The ``abi_types `` value
333- should be a list of solidity type strings which correspond to each of the
334- provided values.
335-
336-
337- .. code-block :: python
338-
339- >> > Web3.soliditySha3([' bool' ], [True ])
340- HexBytes(" 0x5fe7f977e71dba2ea1a68e21057beebb9be2ac30c6410aa38d4f3fbe41dcffd2" )
341-
342- >> > Web3.soliditySha3([' uint8' , ' uint8' , ' uint8' ], [97 , 98 , 99 ])
343- HexBytes(" 0x4e03657aea45a94fc7d47ba826c8d667c0d1e6e33a64a036ec44f58fa12d6c45" )
344-
345- >> > Web3.soliditySha3([' uint8[]' ], [[97 , 98 , 99 ]])
346- HexBytes(" 0x233002c671295529bcc50b76a2ef2b0de2dac2d93945fca745255de1a9e4017e" )
347-
348- >> > Web3.soliditySha3([' address' ], [" 0x49EdDD3769c0712032808D86597B84ac5c2F5614" ])
349- HexBytes(" 0x2ff37b5607484cd4eecf6d13292e22bd6e5401eaffcc07e279583bc742c68882" )
350-
351- >> > Web3.soliditySha3([' address' ], [" ethereumfoundation.eth" ])
352- HexBytes(" 0x913c99ea930c78868f1535d34cd705ab85929b2eaaf70fcd09677ecd6e5d75e9" )
353-
354-
355307 Check Encodability
356308~~~~~~~~~~~~~~~~~~~~
357309
0 commit comments