So far I am using this solidity code
pragma solidity 0.4.24;
contract Converter{
function Converter(){
}
function stringToBytes32(string memory source) returns (bytes32 result) {
bytes memory tempEmptyStringTest = bytes(source);
if (tempEmptyStringTest.length == 0) {
return 0x0;
}
assembly {
result := mload(add(source, 32))
}
}
}
Is there a website or online tool to easily convert strings to bytes32?
For historical reasons, MetaMask injected web3@0.20.7 is deprecated. It has known security issues. It is no longer maintained by the web3.js team.
– YulePale May 24 '21 at 13:50