[Ethereum] How to convert decode/encode string to Base58

encodingremixsolidity

How to convert decode/encode string to Base58 on solidity?

Best Answer

I don't believe there's any built-in function for doing this, but here's a toBase58 implementation: https://github.com/MrChico/verifyIPFS/blob/master/contracts/verifyIPFS.sol#L28.

Depending on your use case, it might be better to have Solidity deal with the raw bytes and convert to/from base58 outside of the contract (e.g. in JavaScript or whatever client language you're using).

Related Topic