• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* LzHash.h -- HASH constants for LZ algorithms
2 2023-03-05 : Igor Pavlov : Public domain */
3 
4 #ifndef ZIP7_INC_LZ_HASH_H
5 #define ZIP7_INC_LZ_HASH_H
6 
7 /*
8   (kHash2Size >= (1 <<  8)) : Required
9   (kHash3Size >= (1 << 16)) : Required
10 */
11 
12 #define kHash2Size (1 << 10)
13 #define kHash3Size (1 << 16)
14 // #define kHash4Size (1 << 20)
15 
16 #define kFix3HashSize (kHash2Size)
17 #define kFix4HashSize (kHash2Size + kHash3Size)
18 // #define kFix5HashSize (kHash2Size + kHash3Size + kHash4Size)
19 
20 /*
21   We use up to 3 crc values for hash:
22     crc0
23     crc1 << Shift_1
24     crc2 << Shift_2
25   (Shift_1 = 5) and (Shift_2 = 10) is good tradeoff.
26   Small values for Shift are not good for collision rate.
27   Big value for Shift_2 increases the minimum size
28   of hash table, that will be slow for small files.
29 */
30 
31 #define kLzHash_CrcShift_1 5
32 #define kLzHash_CrcShift_2 10
33 
34 #endif
35