diff options
author | mvel <mvel@yandex-team.ru> | 2022-02-10 16:45:41 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:41 +0300 |
commit | bd30392c4cc92487950adc375c07adf52da1d592 (patch) | |
tree | e8d1a3f19b7fc890bcef6e4cc5de41f1d88c9ac3 /util/digest | |
parent | 5d50718e66d9c037dc587a0211110b7d25a66185 (diff) | |
download | ydb-bd30392c4cc92487950adc375c07adf52da1d592.tar.gz |
Restoring authorship annotation for <mvel@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'util/digest')
-rw-r--r-- | util/digest/fnv.h | 6 | ||||
-rw-r--r-- | util/digest/fnv_ut.cpp | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/util/digest/fnv.h b/util/digest/fnv.h index 87b41a3de7..efedb95ac9 100644 --- a/util/digest/fnv.h +++ b/util/digest/fnv.h @@ -66,8 +66,8 @@ template <class T> static constexpr T FnvHash(const void* buf, size_t len) { return FnvHash<T>((const unsigned char*)buf, (const unsigned char*)buf + len); } - -template <class T, class Buf> + +template <class T, class Buf> static constexpr T FnvHash(const Buf& buf) { return FnvHash<T>(buf.data(), buf.size() * sizeof(*buf.data())); -} +} diff --git a/util/digest/fnv_ut.cpp b/util/digest/fnv_ut.cpp index ce56642b3e..d295586efd 100644 --- a/util/digest/fnv_ut.cpp +++ b/util/digest/fnv_ut.cpp @@ -4,7 +4,7 @@ Y_UNIT_TEST_SUITE(TFnvTest) { Y_UNIT_TEST(TestFnv32) { - const auto h32 = ULL(2849763999); + const auto h32 = ULL(2849763999); UNIT_ASSERT_EQUAL(FnvHash<ui32>("1234567", 7), h32); UNIT_ASSERT_EQUAL(FnvHash<ui32>(TStringBuf("1234567")), h32); @@ -16,7 +16,7 @@ Y_UNIT_TEST_SUITE(TFnvTest) { const auto h64 = ULL(2449551094593701855); UNIT_ASSERT_EQUAL(FnvHash<ui64>("1234567", 7), h64); UNIT_ASSERT_EQUAL(FnvHash<ui64>(TStringBuf("1234567")), h64); - + UNIT_ASSERT_EQUAL(FnvHash<ui64>(nullptr, 0), FNV64INIT); UNIT_ASSERT_EQUAL(FnvHash<ui64>(TStringBuf()), FNV64INIT); } |