C# Class DS4Windows.Crc32Algorithm

Implements a 32-bit CRC hash algorithm compatible with Zip etc.
Crc32 should only be used for backward compatibility with older file formats and algorithms. It is not secure enough for new applications. If you need to call multiple times for the same data either use the HashAlgorithm interface or remember that the result of one Compute call needs to be ~ (XOR) before being passed in as the seed for the next Compute call.
Inheritance: HashAlgorithm
Afficher le fichier Open project: Yohoki/DS4WindowsEx Class Usage Examples

Méthodes publiques

Méthode Description
CalculateBasicHash ( uint &seed, Array &buffer, int offset, int size ) : uint
CalculateFasterBT78Hash ( uint &seed, Array &buffer, int &start, int &size ) : uint

More optimized CRC-32 algorithm that only works with 78 byte arrays

Compute ( Array buffer ) : uint
Compute ( uint seed, Array buffer ) : uint
Compute ( uint polynomial, uint seed, Array buffer ) : uint
Crc32Algorithm ( ) : System
Crc32Algorithm ( uint polynomial, uint seed ) : System
Initialize ( ) : void
InitializeTable ( uint polynomial ) : uint[]

Méthodes protégées

Méthode Description
HashCore ( Array buffer, int start, int length ) : void
HashFinal ( ) : byte[]

Private Methods

Méthode Description
CalculateHash ( Array table, uint seed, Array buffer, int start, int size ) : uint
UintToBigEndianBytes ( uint uint32 ) : byte[]

Method Details

CalculateBasicHash() public static méthode

public static CalculateBasicHash ( uint &seed, Array &buffer, int offset, int size ) : uint
seed uint
buffer Array
offset int
size int
Résultat uint

CalculateFasterBT78Hash() public static méthode

More optimized CRC-32 algorithm that only works with 78 byte arrays
public static CalculateFasterBT78Hash ( uint &seed, Array &buffer, int &start, int &size ) : uint
seed uint
buffer Array
start int
size int
Résultat uint

Compute() public static méthode

public static Compute ( Array buffer ) : uint
buffer Array
Résultat uint

Compute() public static méthode

public static Compute ( uint seed, Array buffer ) : uint
seed uint
buffer Array
Résultat uint

Compute() public static méthode

public static Compute ( uint polynomial, uint seed, Array buffer ) : uint
polynomial uint
seed uint
buffer Array
Résultat uint

Crc32Algorithm() public méthode

public Crc32Algorithm ( ) : System
Résultat System

Crc32Algorithm() public méthode

public Crc32Algorithm ( uint polynomial, uint seed ) : System
polynomial uint
seed uint
Résultat System

HashCore() protected méthode

protected HashCore ( Array buffer, int start, int length ) : void
buffer Array
start int
length int
Résultat void

HashFinal() protected méthode

protected HashFinal ( ) : byte[]
Résultat byte[]

Initialize() public méthode

public Initialize ( ) : void
Résultat void

InitializeTable() public static méthode

public static InitializeTable ( uint polynomial ) : uint[]
polynomial uint
Résultat uint[]