summaryrefslogtreecommitdiff
path: root/src/buildtool/execution_api/common/execution_common.hpp
diff options
context:
space:
mode:
authorMaksim Denisov <denisov.maksim@huawei.com>2024-07-08 10:12:45 +0200
committerMaksim Denisov <denisov.maksim@huawei.com>2024-07-22 17:01:13 +0200
commitfecf8b5436a8012dc5fdf7f01192e7a6d99530bb (patch)
tree0738e3b53a6256c98138d2d7adfdebb42e9182d3 /src/buildtool/execution_api/common/execution_common.hpp
parentdd23c6e397584f4bf1cf84a73d9c382a8ff81de7 (diff)
downloadjustbuild-fecf8b5436a8012dc5fdf7f01192e7a6d99530bb.tar.gz
Use a fixed HashFunction for creation of UUID4
Diffstat (limited to 'src/buildtool/execution_api/common/execution_common.hpp')
-rw-r--r--src/buildtool/execution_api/common/execution_common.hpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/buildtool/execution_api/common/execution_common.hpp b/src/buildtool/execution_api/common/execution_common.hpp
index 6cb0beda..b6bd1fa0 100644
--- a/src/buildtool/execution_api/common/execution_common.hpp
+++ b/src/buildtool/execution_api/common/execution_common.hpp
@@ -105,8 +105,11 @@ static void EncodeUUIDVariant1(std::string* uuid) {
constexpr auto kRawLength = 16UL;
constexpr auto kHexDashPos = std::array{8UL, 12UL, 16UL, 20UL};
+ // The type of HashFunction is irrelevant here. It is used for
+ // identification purposes only. SHA256 is used.
+ HashFunction const hash_function{HashFunction::JustHash::Compatible};
auto value = fmt::format("{}-{}", std::to_string(kRandomConstant), seed);
- auto uuid = HashFunction::Instance().ComputeHash(value).Bytes();
+ auto uuid = hash_function.ComputeHash(value).Bytes();
EncodeUUIDVersion4(&uuid);
EncodeUUIDVariant1(&uuid);
Expects(uuid.size() >= kRawLength);