diff options
author | tejblum <tejblum@yandex-team.ru> | 2022-02-10 16:48:02 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:48:02 +0300 |
commit | 2bf39531b4f50b889e946ac4866018678a4fb281 (patch) | |
tree | 65ee082892af9db55f726e13950abf0b1cc65992 /library/cpp/digest | |
parent | a61e8c559b6b690a019253067224d595e3d642f1 (diff) | |
download | ydb-2bf39531b4f50b889e946ac4866018678a4fb281.tar.gz |
Restoring authorship annotation for <tejblum@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/digest')
-rw-r--r-- | library/cpp/digest/old_crc/crc.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/library/cpp/digest/old_crc/crc.h b/library/cpp/digest/old_crc/crc.h index 4a3ce6d05e..9f341d1d90 100644 --- a/library/cpp/digest/old_crc/crc.h +++ b/library/cpp/digest/old_crc/crc.h @@ -23,17 +23,17 @@ struct IdTR { Y_FORCE_INLINE static ui8 T(ui8 a) { return a; } -}; - +}; + // CCITT CRC-32 -template <class TR> +template <class TR> inline ui32 crc32(const char* buf, size_t buflen, ui32 crcinit = CRC32INIT) { ui32 crc = crcinit ^ 0xFFFFFFFF; const char* end = buf + buflen; extern const ui32* crctab32; while (buf < end) { - crc = (crc >> 8) ^ crctab32[(crc ^ TR::T((ui8)*buf)) & 0xFF]; + crc = (crc >> 8) ^ crctab32[(crc ^ TR::T((ui8)*buf)) & 0xFF]; ++buf; } @@ -41,9 +41,9 @@ inline ui32 crc32(const char* buf, size_t buflen, ui32 crcinit = CRC32INIT) { } inline ui32 crc32(const char* buf, size_t buflen, ui32 crcinit = CRC32INIT) { - return crc32<IdTR>(buf, buflen, crcinit); -} - + return crc32<IdTR>(buf, buflen, crcinit); +} + inline ui32 crc32(const void* buf, size_t buflen, ui32 crcinit = CRC32INIT) { return crc32((const char*)buf, buflen, crcinit); } |