diff options
author | dakovalkov <dakovalkov@yandex-team.com> | 2023-12-03 13:33:55 +0300 |
---|---|---|
committer | dakovalkov <dakovalkov@yandex-team.com> | 2023-12-03 14:04:39 +0300 |
commit | 2a718325637e5302334b6d0a6430f63168f8dbb3 (patch) | |
tree | 64be81080b7df9ec1d86d053a0c394ae53fcf1fe /contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/HashingUtils.cpp | |
parent | e0d94a470142d95c3007e9c5d80380994940664a (diff) | |
download | ydb-2a718325637e5302334b6d0a6430f63168f8dbb3.tar.gz |
Update contrib/libs/aws-sdk-cpp to 1.11.37
Diffstat (limited to 'contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/HashingUtils.cpp')
-rw-r--r-- | contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/HashingUtils.cpp | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/HashingUtils.cpp b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/HashingUtils.cpp index 0e49a61634..0431835a61 100644 --- a/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/HashingUtils.cpp +++ b/contrib/libs/aws-sdk-cpp/aws-cpp-sdk-core/source/utils/HashingUtils.cpp @@ -11,6 +11,7 @@ #include <aws/core/utils/crypto/Sha256HMAC.h> #include <aws/core/utils/crypto/Sha1.h> #include <aws/core/utils/crypto/MD5.h> +#include <aws/core/utils/crypto/CRC32.h> #include <aws/core/utils/Outcome.h> #include <aws/core/utils/memory/stl/AWSStringStream.h> #include <aws/core/utils/memory/stl/AWSList.h> @@ -234,6 +235,30 @@ ByteBuffer HashingUtils::CalculateMD5(Aws::IOStream& stream) return hash.Calculate(stream).GetResult(); } +ByteBuffer HashingUtils::CalculateCRC32(const Aws::String& str) +{ + CRC32 hash; + return hash.Calculate(str).GetResult(); +} + +ByteBuffer HashingUtils::CalculateCRC32(Aws::IOStream& stream) +{ + CRC32 hash; + return hash.Calculate(stream).GetResult(); +} + +ByteBuffer HashingUtils::CalculateCRC32C(const Aws::String& str) +{ + CRC32C hash; + return hash.Calculate(str).GetResult(); +} + +ByteBuffer HashingUtils::CalculateCRC32C(Aws::IOStream& stream) +{ + CRC32C hash; + return hash.Calculate(stream).GetResult(); +} + int HashingUtils::HashString(const char* strToHash) { if (!strToHash) @@ -242,7 +267,7 @@ int HashingUtils::HashString(const char* strToHash) unsigned hash = 0; while (char charValue = *strToHash++) { - hash = charValue + 31 * hash; + hash = charValue + 31 * hash; } return hash; |