SHA3 Hash's don't match from Javascript and Solidity

CryptoFutureCryptoFuture Member Posts: 44
edited August 2015 in Smart Contracts and Dapps
Hello. I am currently trying the following function in a contract:
function doSHA3(bytes32 input) constant returns (bytes32 hash) { return sha3(input); }

I am then running the following (using the Crypto-JS library):
function doSHA3(input) { return '0x'+CryptoJS.SHA3(input), { outputLength: 256 }); }

Both these functions produce different values. Although if I call them without any input they work. I presume the error lies in the input being supplied as bytes32 on ethereum but as a string on javascript. Any way I can fix this?
Sign In or Register to comment.