MCPcopy Create free account
hub / github.com/argotorg/solidity / hashMatchesContent

Function hashMatchesContent

libsolidity/interface/StandardCompiler.cpp:157–167  ·  view source on GitHub ↗

Returns true iff @a _hash (hex with 0x prefix) is the Keccak256 hash of the binary data in @a _content.

Source from the content-addressed store, hash-verified

155
156/// Returns true iff @a _hash (hex with 0x prefix) is the Keccak256 hash of the binary data in @a _content.
157bool hashMatchesContent(std::string const& _hash, std::string const& _content)
158{
159 try
160 {
161 return util::h256(_hash) == util::keccak256(_content);
162 }
163 catch (util::BadHexCharacter const&)
164 {
165 return false;
166 }
167}
168
169bool isArtifactRequested(Json const& _outputSelection, std::string const& _artifact, bool _wildcardMatchesExperimental)
170{

Callers 1

parseInputMethod · 0.85

Calls 1

keccak256Function · 0.50

Tested by

no test coverage detected