Skip to content

Instantly share code, notes, and snippets.

@mradkov
Last active November 30, 2018 08:11
/*
* @dev - Get (domain name + top level) hash used for unique identifier
* @param domain
* @param topLevel
* @return domainHash
*/
function getDomainHash(bytes memory domain, bytes12 topLevel) public pure returns(bytes32) {
// @dev - tightly pack parameters in struct for keccak256
return keccak256(abi.encodePacked(domain, topLevel));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment