- First LZMA enhanced NSIS version - experimental
- Added SetCompressorDictSize (only works for LZMA) - Added SetCompressionLevel (only "works" for zlib and bzip2) - doesn't work for now - Section is only supposed to get 4 parameters if /o is specified - Updated version numbers git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@3190 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
320cefa4b0
commit
594c3ed0f6
84 changed files with 8083 additions and 41 deletions
31
Source/7zip/Common/CRC.h
Normal file
31
Source/7zip/Common/CRC.h
Normal file
|
@ -0,0 +1,31 @@
|
|||
// Common/CRC.h
|
||||
|
||||
// #pragma once
|
||||
|
||||
#ifndef __COMMON_CRC_H
|
||||
#define __COMMON_CRC_H
|
||||
|
||||
#include "Types.h"
|
||||
|
||||
class CCRC
|
||||
{
|
||||
UINT32 _value;
|
||||
public:
|
||||
static UINT32 Table[256];
|
||||
CCRC(): _value(0xFFFFFFFF){};
|
||||
void Init() { _value = 0xFFFFFFFF; }
|
||||
void Update(const void *data, UINT32 size);
|
||||
UINT32 GetDigest() const { return _value ^ 0xFFFFFFFF; }
|
||||
static UINT32 CalculateDigest(const void *data, UINT32 size)
|
||||
{
|
||||
CCRC crc;
|
||||
crc.Update(data, size);
|
||||
return crc.GetDigest();
|
||||
}
|
||||
static bool VerifyDigest(UINT32 digest, const void *data, UINT32 size)
|
||||
{
|
||||
return (CalculateDigest(data, size) == digest);
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue