diff options
author | Igor Pavlov <87184205+ip7z@users.noreply.github.com> | 2021-12-27 00:00:00 +0000 |
---|---|---|
committer | Igor Pavlov <87184205+ip7z@users.noreply.github.com> | 2022-03-18 15:35:13 +0500 |
commit | f19f813537c7aea1c20749c914e756b54a9c3cf5 (patch) | |
tree | 816ba62ca7c0fa19f2eb46d9e9d6f7dd7c3a744d /C/XzCrc64.h | |
parent | 98e06a519b63b81986abe76d28887f6984a7732b (diff) | |
download | 7zip-21.07.tar.gz 7zip-21.07.tar.bz2 7zip-21.07.zip |
'21.07'21.07
Diffstat (limited to 'C/XzCrc64.h')
-rw-r--r-- | C/XzCrc64.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/C/XzCrc64.h b/C/XzCrc64.h new file mode 100644 index 0000000..08dbc33 --- /dev/null +++ b/C/XzCrc64.h | |||
@@ -0,0 +1,26 @@ | |||
1 | /* XzCrc64.h -- CRC64 calculation | ||
2 | 2013-01-18 : Igor Pavlov : Public domain */ | ||
3 | |||
4 | #ifndef __XZ_CRC64_H | ||
5 | #define __XZ_CRC64_H | ||
6 | |||
7 | #include <stddef.h> | ||
8 | |||
9 | #include "7zTypes.h" | ||
10 | |||
11 | EXTERN_C_BEGIN | ||
12 | |||
13 | extern UInt64 g_Crc64Table[]; | ||
14 | |||
15 | void MY_FAST_CALL Crc64GenerateTable(void); | ||
16 | |||
17 | #define CRC64_INIT_VAL UINT64_CONST(0xFFFFFFFFFFFFFFFF) | ||
18 | #define CRC64_GET_DIGEST(crc) ((crc) ^ CRC64_INIT_VAL) | ||
19 | #define CRC64_UPDATE_BYTE(crc, b) (g_Crc64Table[((crc) ^ (b)) & 0xFF] ^ ((crc) >> 8)) | ||
20 | |||
21 | UInt64 MY_FAST_CALL Crc64Update(UInt64 crc, const void *data, size_t size); | ||
22 | UInt64 MY_FAST_CALL Crc64Calc(const void *data, size_t size); | ||
23 | |||
24 | EXTERN_C_END | ||
25 | |||
26 | #endif | ||