github.com/muhammedhassanm/blockchain@v0.0.0-20200120143007-697261defd4d/blockapps-ba-master/server/lib/common/Util.sol (about)

     1  /**
     2   * Util contract
     3   */
     4  contract Util {
     5    function stringToBytes32(string memory source) returns (bytes32 result) {
     6        assembly {
     7            result := mload(add(source, 32))
     8        }
     9    }
    10  
    11    function b32(string memory source) returns (bytes32) {
    12      return stringToBytes32(source);
    13    }
    14  }