13

I have functions which are forced to return a bytes32 object, but then in my webapp I need to reconvert them to a classic string. How can I do that?

15

Try using the web3.js function web3.toAscii (doc), which might change name to web3.toUtf8 or something similar in the future.

0

In version 1.0 of web3 js use the new utils function

web3.utils.hexToAscii('0x4920686176652031303021')

doc

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.