     function toEthereumSignedMessage(string _msg) public pure returns (bytes32) {
         uint len = bytes(_msg).length;
         require(len > 0);
         bytes memory prefix = "\x19Ethereum Signed Message:\n";
         return keccak256(abi.encodePacked(prefix, uintToString(len), _msg));
     }