I would like to generate hash value within Truffle using the web3.sha3() function and the hash value is required to be consistent with that one generated in Solidity. The basic example is sha3(uint256(1)). I read the related question here How does Solidity's sha3 / keccak256 hash uints? However the LEFTPAD method is not supported in Truffle so I did the hashing in the following way:
(within Truffle) web3.sha3("0x000000......000001") which produced "0xcb371be217faa47dab94e0d0ff0840c6cbf41645f0dc1a6ae3f34447155a76f3"
(within solidity) sha3(uint256(1)) whcih produced "0xb10e2d527612073b26eecdfd717e6a320cf44b4afac2b0732d9fcbe2b7fa0cf6"
These two values are apparently not the same. I would like to know how can I generate the same hash in Truffle with respect to this given example.