C# Class DamienG.Security.Cryptography.Crc32

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: System.Security.Cryptography.HashAlgorithm
Mostrar archivo Open project: damieng/DamienGKit Class Usage Examples

Public Methods

Method Description
Compute ( UInt32 polynomial, UInt32 seed, byte buffer ) : UInt32
Compute ( UInt32 seed, byte buffer ) : UInt32
Compute ( byte buffer ) : UInt32
Crc32 ( ) : System
Crc32 ( UInt32 polynomial, UInt32 seed ) : System
Initialize ( ) : void

Protected Methods

Method Description
HashCore ( byte array, int ibStart, int cbSize ) : void
HashFinal ( ) : byte[]

Private Methods

Method Description
CalculateHash ( UInt32 table, UInt32 seed, IList buffer, int start, int size ) : UInt32
InitializeTable ( UInt32 polynomial ) : System.UInt32[]
UInt32ToBigEndianBytes ( UInt32 uint32 ) : byte[]

Method Details

Compute() public static method

public static Compute ( UInt32 polynomial, UInt32 seed, byte buffer ) : UInt32
polynomial System.UInt32
seed System.UInt32
buffer byte
return System.UInt32

Compute() public static method

public static Compute ( UInt32 seed, byte buffer ) : UInt32
seed System.UInt32
buffer byte
return System.UInt32

Compute() public static method

public static Compute ( byte buffer ) : UInt32
buffer byte
return System.UInt32

Crc32() public method

public Crc32 ( ) : System
return System

Crc32() public method

public Crc32 ( UInt32 polynomial, UInt32 seed ) : System
polynomial System.UInt32
seed System.UInt32
return System

HashCore() protected method

protected HashCore ( byte array, int ibStart, int cbSize ) : void
array byte
ibStart int
cbSize int
return void

HashFinal() protected method

protected HashFinal ( ) : byte[]
return byte[]

Initialize() public method

public Initialize ( ) : void
return void