I want to hash two values(integer and string) in contract and get the same hash using these values at backend, but can't quite figure out what to do. Here are contract and JS code below.
pragma solidity ^0.4.0;
contract Contract {
function hashIt(string a, uint b) returns(bytes32){
return sha3(a, b);
}
}
Input: "1", 1
Output: 0x79e6f3a7968620dde8ba64f1f6d03f034d481c27d094c568f6475e60a9dbc4dc
ethutils.bufferToHex(ethutils.sha3());
Input: ["1", 1],
Output: 0x4535a04e923af75e64a9f6cdfb922004b40beec0649d36cf6ea095b7c4975cae
web3.sha3()
Input: "1", 1
Output: 0xc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc6