From 1ea0b1d9ff98d8c44658046019c94f5952ad5c66 Mon Sep 17 00:00:00 2001 From: Oliver Reiche Date: Tue, 14 Jun 2022 18:41:53 +0200 Subject: Crypto: Add and use set of globally used hash functions --- src/buildtool/build_engine/expression/expression.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/buildtool/build_engine/expression/expression.cpp') diff --git a/src/buildtool/build_engine/expression/expression.cpp b/src/buildtool/build_engine/expression/expression.cpp index 763f51f8..91d293bc 100644 --- a/src/buildtool/build_engine/expression/expression.cpp +++ b/src/buildtool/build_engine/expression/expression.cpp @@ -220,10 +220,10 @@ auto Expression::ComputeHash() const noexcept -> std::string { : IsNode() ? "#" : IsName() ? "$" : ""}; - hash = hash_gen_.Run(prefix + ToString()).Bytes(); + hash = HashFunction::ComputeHash(prefix + ToString()).Bytes(); } else { - auto hasher = hash_gen_.IncrementalHasher(); + auto hasher = HashFunction::Hasher(); if (IsList()) { auto list = Value(); hasher.Update("["); @@ -235,7 +235,7 @@ auto Expression::ComputeHash() const noexcept -> std::string { auto map = Value(); hasher.Update("{"); for (auto const& el : map->get()) { - hasher.Update(hash_gen_.Run(el.first).Bytes()); + hasher.Update(HashFunction::ComputeHash(el.first).Bytes()); hasher.Update(el.second->ToHash()); } } -- cgit v1.2.3