diff options
Diffstat (limited to 'common/hash_calculator.cc')
-rw-r--r-- | common/hash_calculator.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/common/hash_calculator.cc b/common/hash_calculator.cc index d010a532..60812d56 100644 --- a/common/hash_calculator.cc +++ b/common/hash_calculator.cc @@ -95,6 +95,11 @@ bool HashCalculator::RawHashOfData(const brillo::Blob& data, return RawHashOfBytes(data.data(), data.size(), out_hash); } +bool HashCalculator::RawHashOfFile(const string& name, brillo::Blob* out_hash) { + const auto file_size = utils::FileSize(name); + return RawHashOfFile(name, file_size, out_hash) == file_size; +} + off_t HashCalculator::RawHashOfFile(const string& name, off_t length, brillo::Blob* out_hash) { |