aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/digest/crc32c/crc32c.cpp
diff options
context:
space:
mode:
authora-romanov <a-romanov@yandex-team.ru>2022-02-10 16:48:11 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:48:11 +0300
commit0f4c5d1e8c0672bf0a1f2f2d8acac5ba24772435 (patch)
treeb222e5ac2e2e98872661c51ccceee5da0d291e13 /library/cpp/digest/crc32c/crc32c.cpp
parentaa2986a34bde73b2cdcea5080c4443b7cf2ba686 (diff)
downloadydb-0f4c5d1e8c0672bf0a1f2f2d8acac5ba24772435.tar.gz
Restoring authorship annotation for <a-romanov@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/digest/crc32c/crc32c.cpp')
-rw-r--r--library/cpp/digest/crc32c/crc32c.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/library/cpp/digest/crc32c/crc32c.cpp b/library/cpp/digest/crc32c/crc32c.cpp
index d9e56ec006..369b46a213 100644
--- a/library/cpp/digest/crc32c/crc32c.cpp
+++ b/library/cpp/digest/crc32c/crc32c.cpp
@@ -1,35 +1,35 @@
-#include "crc32c.h"
+#include "crc32c.h"
+
+#include <util/generic/singleton.h>
+
+#include <contrib/libs/crcutil/interface.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);