diff options
author | Oliver Reiche <oliver.reiche@huawei.com> | 2022-06-14 18:41:53 +0200 |
---|---|---|
committer | Oliver Reiche <oliver.reiche@huawei.com> | 2022-06-20 15:23:02 +0200 |
commit | 1ea0b1d9ff98d8c44658046019c94f5952ad5c66 (patch) | |
tree | a4f8b95b249f55f6e5c042319f65e0a50d1785a3 /src/buildtool/build_engine/target_map/utils.cpp | |
parent | 7bfe61079b0355d260b977193e3b05be969ca068 (diff) | |
download | justbuild-1ea0b1d9ff98d8c44658046019c94f5952ad5c66.tar.gz |
Crypto: Add and use set of globally used hash functions
Diffstat (limited to 'src/buildtool/build_engine/target_map/utils.cpp')
-rw-r--r-- | src/buildtool/build_engine/target_map/utils.cpp | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/buildtool/build_engine/target_map/utils.cpp b/src/buildtool/build_engine/target_map/utils.cpp index ea3ce0a5..136727bc 100644 --- a/src/buildtool/build_engine/target_map/utils.cpp +++ b/src/buildtool/build_engine/target_map/utils.cpp @@ -165,12 +165,9 @@ auto BuildMaps::Target::Utils::getTainted( namespace { auto hash_vector(std::vector<std::string> const& vec) -> std::string { - auto hasher = HashGenerator{BuildMaps::Target::Utils::kActionHash} - .IncrementalHasher(); + auto hasher = HashFunction::Hasher(); for (auto const& s : vec) { - hasher.Update(HashGenerator{BuildMaps::Target::Utils::kActionHash} - .Run(s) - .Bytes()); + hasher.Update(HashFunction::ComputeHash(s).Bytes()); } auto digest = std::move(hasher).Finalize(); if (not digest) { @@ -189,8 +186,7 @@ auto BuildMaps::Target::Utils::createAction( std::optional<std::string> may_fail, bool no_cache, const ExpressionPtr& inputs_exp) -> ActionDescription::Ptr { - auto hasher = HashGenerator{BuildMaps::Target::Utils::kActionHash} - .IncrementalHasher(); + auto hasher = HashFunction::Hasher(); hasher.Update(hash_vector(output_files)); hasher.Update(hash_vector(output_dirs)); hasher.Update(hash_vector(command)); |