How can I convert a string to a bytes32?
Does anyone has a magic function or library which does it?
For example, this will works since as input I gave bytes32 . But it does not work with the characters greater than bytes32.
tx_hash = a.transact().set("QmVoGzRDscx61k3RHHkLYaMFtxYZi3ps") // 32-bit char
function get() returns (string value) {
return list.get_head_data();
}
But if I need to give more character for example contains 48-bit string this won't work. How could I make this work?
bytes32 result :=while my code is declaring result type inreturns (bytes32 result), just remove thebytes32from beforeresult := ...and it should compile. – Grzegorz Kapkowski Oct 10 '16 at 12:42