How can I repeat this operation on web3.js and get the same hash

function test(uint a, uint b) pure public returns (bytes32) {
    bytes32 hash = keccak256(abi.encodePacked(uint40(a), b);
    return hash;
  • a - last block number
  • b - is a large number like this: 58984214690415138970779328130626583025560028195120217299604246549340745742299

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.