diff options
author | a-romanov <a-romanov@yandex-team.ru> | 2022-02-10 16:48:10 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:48:10 +0300 |
commit | aa2986a34bde73b2cdcea5080c4443b7cf2ba686 (patch) | |
tree | 410fbde59311309b774a0da147f79628c3429a2c /library/cpp/digest | |
parent | e77cfd118321c5b9c168fdee41b4e6c5706b8f68 (diff) | |
download | ydb-aa2986a34bde73b2cdcea5080c4443b7cf2ba686.tar.gz |
Restoring authorship annotation for <a-romanov@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/digest')
-rw-r--r-- | library/cpp/digest/crc32c/crc32c.cpp | 24 | ||||
-rw-r--r-- | library/cpp/digest/crc32c/crc32c.h | 8 | ||||
-rw-r--r-- | library/cpp/digest/crc32c/ya.make | 2 |
3 files changed, 17 insertions, 17 deletions
diff --git a/library/cpp/digest/crc32c/crc32c.cpp b/library/cpp/digest/crc32c/crc32c.cpp index 369b46a213..d9e56ec006 100644 --- a/library/cpp/digest/crc32c/crc32c.cpp +++ b/library/cpp/digest/crc32c/crc32c.cpp @@ -1,35 +1,35 @@ -#include "crc32c.h" - -#include <util/generic/singleton.h> - -#include <contrib/libs/crcutil/interface.h> +#include "crc32c.h" +#include <util/generic/singleton.h> + +#include <contrib/libs/crcutil/interface.h> + namespace { typedef crcutil_interface::CRC TCrc; struct TCrcUtilSse4 { TCrc* const Pimpl; - - TCrcUtilSse4() noexcept + + TCrcUtilSse4() noexcept : Pimpl(TCrc::Create(0x82f63b78, 0, 32, true, 0, 0, 0, TCrc::IsSSE42Available(), nullptr)) { } - + ~TCrcUtilSse4() noexcept { Pimpl->Delete(); } - + inline ui32 Extend(ui32 init, const void* data, size_t n) const noexcept { crcutil_interface::UINT64 sum = init; Pimpl->Compute(data, n, &sum); return (ui32)sum; } - }; + }; } - + ui32 Crc32c(const void* p, size_t size) noexcept { return Singleton<TCrcUtilSse4>()->Extend(0, p, size); -} +} ui32 Crc32cExtend(ui32 init, const void* data, size_t n) noexcept { return Singleton<TCrcUtilSse4>()->Extend(init, data, n); diff --git a/library/cpp/digest/crc32c/crc32c.h b/library/cpp/digest/crc32c/crc32c.h index 17b554c8e1..054f65dd83 100644 --- a/library/cpp/digest/crc32c/crc32c.h +++ b/library/cpp/digest/crc32c/crc32c.h @@ -1,8 +1,8 @@ -#pragma once - +#pragma once + #include <util/system/types.h> - -// Threadsafe + +// Threadsafe ui32 Crc32c(const void* p, size_t size) noexcept; ui32 Crc32cExtend(ui32 init, const void* data, size_t n) noexcept; diff --git a/library/cpp/digest/crc32c/ya.make b/library/cpp/digest/crc32c/ya.make index d6faf16c9c..d07f0a8e75 100644 --- a/library/cpp/digest/crc32c/ya.make +++ b/library/cpp/digest/crc32c/ya.make @@ -16,7 +16,7 @@ PEERDIR( ) SRCS( - crc32c.cpp + crc32c.cpp ) END() |