upgraded to lzma sdk 4.43 for faster compression
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@4772 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
51a96f2d75
commit
2cd2142ca3
42 changed files with 1900 additions and 1572 deletions
|
@ -3,6 +3,7 @@
|
|||
#ifndef __COMMON_CRC_H
|
||||
#define __COMMON_CRC_H
|
||||
|
||||
#include <stddef.h>
|
||||
#include "Types.h"
|
||||
|
||||
class CCRC
|
||||
|
@ -14,18 +15,19 @@ public:
|
|||
|
||||
CCRC(): _value(0xFFFFFFFF){};
|
||||
void Init() { _value = 0xFFFFFFFF; }
|
||||
void Update(Byte v);
|
||||
void Update(UInt32 v);
|
||||
void Update(const UInt64 &v);
|
||||
void Update(const void *data, UInt32 size);
|
||||
void UpdateByte(Byte v);
|
||||
void UpdateUInt16(UInt16 v);
|
||||
void UpdateUInt32(UInt32 v);
|
||||
void UpdateUInt64(UInt64 v);
|
||||
void Update(const void *data, size_t size);
|
||||
UInt32 GetDigest() const { return _value ^ 0xFFFFFFFF; }
|
||||
static UInt32 CalculateDigest(const void *data, UInt32 size)
|
||||
static UInt32 CalculateDigest(const void *data, size_t size)
|
||||
{
|
||||
CCRC crc;
|
||||
crc.Update(data, size);
|
||||
return crc.GetDigest();
|
||||
}
|
||||
static bool VerifyDigest(UInt32 digest, const void *data, UInt32 size)
|
||||
static bool VerifyDigest(UInt32 digest, const void *data, size_t size)
|
||||
{
|
||||
return (CalculateDigest(data, size) == digest);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue