Skip to content

Instantly share code, notes, and snippets.

@phunguyen19
Last active June 10, 2022 13:56
Show Gist options
  • Select an option

  • Save phunguyen19/0031670f26145d34e76f0f93dd0f43b0 to your computer and use it in GitHub Desktop.

Select an option

Save phunguyen19/0031670f26145d34e76f0f93dd0f43b0 to your computer and use it in GitHub Desktop.
solidity compare strings
// Compare 2 strings in solidity ^0.4.23;
function compareStrings(string a, string b) internal pure returns (bool){
return keccak256(a) == keccak256(b);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment