-
-
Save rosdec/a58b069248c80608030a8f26444c7500 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.7.1; | |
contract C { | |
function compare(string memory s1, string memory s2) public pure returns (bool) { | |
return keccak256(abi.encodePacked(s1)) == keccak256(abi.encodePacked(s2)); | |
} | |
function concatenate(string memory s1, string memory s2) public pure returns (string memory) { | |
return string(abi.encodePacked(s1, s2)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment