Skip to content

Commit

Permalink
Fixed type static conversion errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
nthnn committed Nov 30, 2024
1 parent 6b7ea9f commit 1d61aec
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/quickdigest5.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,11 +190,11 @@ std::vector<uint8_t> QuickDigest5::digestFile(const std::string& filepath) {
std::vector<uint8_t> buffer(4096);

while(file) {
file.read(reinterpret_cast<char*>(buffer.data()), (size_t) buffer.size());
file.read(reinterpret_cast<char*>(buffer.data()), (std::streamsize) buffer.size());

std::streamsize bytesRead = file.gcount();
if(bytesRead > 0)
QuickDigest5.update(buffer.data(), bytesRead);
QuickDigest5.update(buffer.data(), (size_t) bytesRead);
}

QuickDigest5.finalize();
Expand All @@ -209,7 +209,7 @@ std::string QuickDigest5::toHash(const std::string& input) {
ss << std::hex
<< std::setw(2)
<< std::setfill('0')
<< (int) digest[i];
<< (int) digest[(size_t) i];

return ss.str();
}
Expand All @@ -222,7 +222,7 @@ std::string QuickDigest5::fileToHash(const std::string& filepath) {
ss << std::hex
<< std::setw(2)
<< std::setfill('0')
<< (int) digest[i];
<< (int) digest[(size_t) i];

return ss.str();
}

0 comments on commit 1d61aec

Please sign in to comment.