diff options
| author | tejblum <[email protected]> | 2022-02-10 16:48:02 +0300 | 
|---|---|---|
| committer | Daniil Cherednik <[email protected]> | 2022-02-10 16:48:02 +0300 | 
| commit | 6ab7e5f5ada0643a48d393717f443bd548706ffc (patch) | |
| tree | b222e5ac2e2e98872661c51ccceee5da0d291e13 /library/cpp/digest/old_crc | |
| parent | 2bf39531b4f50b889e946ac4866018678a4fb281 (diff) | |
Restoring authorship annotation for <[email protected]>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/digest/old_crc')
| -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 9f341d1d905..4a3ce6d05e6 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);  } | 
