diff options
| author | Carl Hetherington <cth@carlh.net> | 2021-12-23 23:33:56 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2021-12-25 02:07:56 +0100 |
| commit | 9da422177392fb9e036bf6ead51f71ee6f3b7d9c (patch) | |
| tree | 9b516d910d5e9ba74383ccfc4f41725cec8af0f1 /src/lib/util.cc | |
| parent | 9f666a0f0191406ef444b48916ae4bb15bd1fca1 (diff) | |
Extract simple_digest().
Diffstat (limited to 'src/lib/util.cc')
| -rw-r--r-- | src/lib/util.cc | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/lib/util.cc b/src/lib/util.cc index c165a5129..64fdd6a37 100644 --- a/src/lib/util.cc +++ b/src/lib/util.cc @@ -529,6 +529,14 @@ digest_head_tail (vector<boost::filesystem::path> files, boost::uintmax_t size) return digester.get (); } + +string +simple_digest (vector<boost::filesystem::path> paths) +{ + return digest_head_tail(paths, 1000000) + raw_convert<string>(boost::filesystem::file_size(paths.front())); +} + + /** Round a number up to the nearest multiple of another number. * @param c Index. * @param stride Array of numbers to round, indexed by c. |
