MCPcopy Create free account
hub / github.com/ClickHouse/ClickHouse / computeMD5Hash

Function computeMD5Hash

src/Common/LLVMCoverageMapping.cpp:27–34  ·  view source on GitHub ↗

Compute MD5Hash the same way LLVM does: MD5 digest, return first 8 bytes as little-endian uint64. This matches IndexedInstrProf::ComputeHash() which is used to compute FilenamesRef.

Source from the content-addressed store, hash-verified

25/// Compute MD5Hash the same way LLVM does: MD5 digest, return first 8 bytes as little-endian uint64.
26/// This matches IndexedInstrProf::ComputeHash() which is used to compute FilenamesRef.
27uint64_t computeMD5Hash(const uint8_t * data, size_t len)
28{
29 unsigned char digest[MD5_DIGEST_LENGTH]; // NOLINT
30 MD5(data, len, digest); // NOLINT
31 uint64_t result;
32 memcpy(&result, digest, 8);
33 return result;
34}
35
36/// Read an unsigned LEB128 value from buf, advance buf, return value.
37/// Sets ok = false and returns 0 on truncated input or overflow.

Callers 1

parseCovMapFilenamesFunction · 0.85

Calls 1

memcpyFunction · 0.85

Tested by

no test coverage detected