2

I am trying to convert the string function name Double(int256) to hash using the Keccak-256 SHA3 algorithm using web3sha3 for curl.

In geth I use the command as such web3.sha3('double(int256)') and it works nicely.

However trying this using a curl command as such doesn't work.

curl -X POST --data '{"jsonrpc":"2.0","method":"web3_sha3","params":["double(int256]","id":64}'

Do I have to convert the function name into some other format first before using curl to make it work?

2

and moments later I figure it out..

You have to convert the string to hexadecimal and use that as the input for the params

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.