MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / CreateMd5FileString

Function CreateMd5FileString

lib/mdflib/mdflib/src/cryptoutil.cpp:286–297  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

284}
285
286std::string CreateMd5FileString(const std::string &file) {
287 std::vector<uint8_t> checksum(16, 0);
288 const auto ok = CreateMd5FileChecksum(file, checksum);
289 std::ostringstream temp;
290 if (ok) {
291 for (auto byte : checksum) {
292 temp << std::uppercase << std::setfill('0') << std::setw(2) << std::hex
293 << static_cast<uint16_t>(byte);
294 }
295 }
296 return temp.str();
297}
298
299} // namespace mdf

Callers 1

TESTFunction · 0.85

Calls 1

CreateMd5FileChecksumFunction · 0.85

Tested by 1

TESTFunction · 0.68