current position:Home>How does Sha3 / keccak256 in solidity calculate the cell hash value?

How does Sha3 / keccak256 in solidity calculate the cell hash value?

2022-02-03 20:47:28 Q & A of Denglian community

This is not about Ethereum use Nonstandard sha3 The problem of . I found the right JS Hashiku , And be able to JS The hash value in is the same as Solidity Byte string matches . What I want to know is : When I put the unit uint Pass to JS Hash library error , How to represent this unit , Make it produce the same results as Solidity sha3 The generated hash value is the same .

JS'0x' + keccak(  1)// 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470Soliditysha3(  1);// 0x5fe7f977e71dba2ea1a68e21057beebb9be2ac30c6410aa38d4f3fbe41dcffd2

Link to the original text




copyright notice
author[Q & A of Denglian community],Please bring the original link to reprint, thank you.
https://en.netfreeman.com/2022/02/202202032047255107.html

Random recommended