summaryrefslogtreecommitdiff
path: root/src/buildtool/execution_api/common
diff options
context:
space:
mode:
authorOliver Reiche <oliver.reiche@huawei.com>2022-06-14 18:41:53 +0200
committerOliver Reiche <oliver.reiche@huawei.com>2022-06-20 15:23:02 +0200
commit1ea0b1d9ff98d8c44658046019c94f5952ad5c66 (patch)
treea4f8b95b249f55f6e5c042319f65e0a50d1785a3 /src/buildtool/execution_api/common
parent7bfe61079b0355d260b977193e3b05be969ca068 (diff)
downloadjustbuild-1ea0b1d9ff98d8c44658046019c94f5952ad5c66.tar.gz
Crypto: Add and use set of globally used hash functions
Diffstat (limited to 'src/buildtool/execution_api/common')
-rw-r--r--src/buildtool/execution_api/common/TARGETS2
-rw-r--r--src/buildtool/execution_api/common/execution_common.hpp4
2 files changed, 3 insertions, 3 deletions
diff --git a/src/buildtool/execution_api/common/TARGETS b/src/buildtool/execution_api/common/TARGETS
index 6994e247..e6043889 100644
--- a/src/buildtool/execution_api/common/TARGETS
+++ b/src/buildtool/execution_api/common/TARGETS
@@ -11,7 +11,7 @@
, "deps":
[ ["@", "gsl-lite", "", "gsl-lite"]
, ["src/buildtool/common", "common"]
- , ["src/buildtool/crypto", "hash_generator"]
+ , ["src/buildtool/crypto", "hash_function"]
, ["src/buildtool/file_system", "object_type"]
, ["src/buildtool/execution_api/bazel_msg", "bazel_msg"]
, ["src/buildtool/execution_api/bazel_msg", "bazel_msg_factory"]
diff --git a/src/buildtool/execution_api/common/execution_common.hpp b/src/buildtool/execution_api/common/execution_common.hpp
index 1208fc99..a3b364d9 100644
--- a/src/buildtool/execution_api/common/execution_common.hpp
+++ b/src/buildtool/execution_api/common/execution_common.hpp
@@ -17,7 +17,7 @@
#include <thread>
#include "gsl-lite/gsl-lite.hpp"
-#include "src/buildtool/crypto/hash_generator.hpp"
+#include "src/buildtool/crypto/hash_function.hpp"
#include "src/buildtool/logging/logger.hpp"
#include "src/utils/cpp/hex_string.hpp"
@@ -89,7 +89,7 @@ static void EncodeUUIDVariant1(std::string* uuid) {
constexpr auto kHexDashPos = std::array{8UL, 12UL, 16UL, 20UL};
auto value = fmt::format("{}-{}", std::to_string(kRandomConstant), seed);
- auto uuid = HashGenerator::Instance().Run(value).Bytes();
+ auto uuid = HashFunction::ComputeHash(value).Bytes();
EncodeUUIDVersion4(&uuid);
EncodeUUIDVariant1(&uuid);
gsl_Expects(uuid.size() >= kRawLength);