unrarsrc  6.1.7
About: unrar extracts, views and tests the contents of archives created with the RAR archiver.
  Fossies Dox: unrarsrc-6.1.7.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

hash.hpp
Go to the documentation of this file.
1#ifndef _RAR_DATAHASH_
2#define _RAR_DATAHASH_
3
5
7{
8 void Init(HASH_TYPE Type);
9 bool operator == (const HashValue &cmp);
10 bool operator != (const HashValue &cmp) {return !(*this==cmp);}
11
13 union
14 {
17 };
18};
19
20
21#ifdef RAR_SMP
22class ThreadPool;
23class DataHash;
24#endif
25
26
28{
29 private:
33
34#ifdef RAR_SMP
35 ThreadPool *ThPool;
36
37 uint MaxThreads;
38 // Upper limit for maximum threads to prevent wasting threads in pool.
39 static const uint MaxHashThreads=8;
40#endif
41 public:
42 DataHash();
43 ~DataHash();
44 void Init(HASH_TYPE Type,uint MaxThreads);
45 void Update(const void *Data,size_t DataSize);
46 void Result(HashValue *Result);
47 uint GetCRC32();
48 bool Cmp(HashValue *CmpValue,byte *Key);
50};
51
52#endif
void Init(HASH_TYPE Type, uint MaxThreads)
Definition: hash.cpp:67
DataHash()
Definition: hash.cpp:42
uint CurCRC32
Definition: hash.hpp:31
void Update(const void *Data, size_t DataSize)
Definition: hash.cpp:84
~DataHash()
Definition: hash.cpp:53
HASH_TYPE HashType
Definition: hash.hpp:30
void Result(HashValue *Result)
Definition: hash.cpp:106
HASH_TYPE Type()
Definition: hash.hpp:49
bool Cmp(HashValue *CmpValue, byte *Key)
Definition: hash.cpp:128
uint GetCRC32()
Definition: hash.cpp:122
blake2sp_state * blake2ctx
Definition: hash.hpp:32
HASH_TYPE
Definition: hash.hpp:4
@ HASH_NONE
Definition: hash.hpp:4
@ HASH_RAR14
Definition: hash.hpp:4
@ HASH_CRC32
Definition: hash.hpp:4
@ HASH_BLAKE2
Definition: hash.hpp:4
unsigned int uint
Definition: rartypes.hpp:8
#define SHA256_DIGEST_SIZE
Definition: sha256.hpp:4
byte Digest[SHA256_DIGEST_SIZE]
Definition: hash.hpp:16
void Init(HASH_TYPE Type)
Definition: hash.cpp:3
bool operator!=(const HashValue &cmp)
Definition: hash.hpp:10
HASH_TYPE Type
Definition: hash.hpp:12
bool operator==(const HashValue &cmp)
Definition: hash.cpp:29
uint CRC32
Definition: hash.hpp:15