9 using System.Runtime.InteropServices;
15 #region ChecksumGeneratorBase
74 Update(data, 0, data.Length);
84 Update(Encoding.UTF8.GetBytes(data));
108 [DllImport(
"ZLIB1.dll", CallingConvention=CallingConvention.Cdecl)]
135 if (
offset < 0 ||
count < 0)
throw new ArgumentOutOfRangeException();
136 if ((
offset+
count) > data.Length)
throw new ArgumentException();
137 GCHandle hData = GCHandle.Alloc(data, GCHandleType.Pinned);
159 [DllImport(
"ZLIB1.dll", CallingConvention=CallingConvention.Cdecl)]
186 if (
offset < 0 ||
count < 0)
throw new ArgumentOutOfRangeException();
187 if ((
offset+
count) > data.Length)
throw new ArgumentException();
188 GCHandle hData = GCHandle.Alloc(data, GCHandleType.Pinned);
Implements a checksum generator that computes the Adler checksum on data
static uint adler32(uint adler, int data, uint length)
override void Update(byte[] data, int offset, int count)
Updates the current checksum with part of an array of bytes
AdlerChecksum()
Initializes a new instance of the Adler checksum generator
AdlerChecksum(uint initialValue)
Initializes a new instance of the Adler checksum generator with a specified value
Implements a CRC32 checksum generator
CRC32Checksum(uint initialValue)
Initializes a new instance of the CRC32 checksum generator with a specified value
static uint crc32(uint crc, int data, uint length)
CRC32Checksum()
Initializes a new instance of the CRC32 checksum generator
override void Update(byte[] data, int offset, int count)
Updates the current checksum with part of an array of bytes
Implements the common functionality needed for all ChecksumGenerators
uint Value
Gets the current checksum value
void Update(byte[] data)
Updates the current checksum with an array of bytes.
ChecksumGeneratorBase()
Initializes a new instance of the checksum generator base - the current checksum is set to zero
void Update(string data)
Updates the current checksum with the data from a string
abstract void Update(byte[] data, int offset, int count)
Updates the current checksum with part of an array of bytes
void Reset()
Resets the current checksum to zero
ChecksumGeneratorBase(uint initialValue)
Initializes a new instance of the checksum generator basewith a specified value
void Update(string data, Encoding encoding)
Updates the current checksum with the data from a string, using a specific encoding
uint _current
The value of the current checksum
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd static protocol static who struct sockaddr static addrlen static backlog struct timeval struct timezone static tz const struct iovec static count static mode const void const struct sockaddr static tolen const char static pathname void count
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd static protocol static who struct sockaddr static addrlen static backlog struct timeval struct timezone static tz const struct iovec static count static mode const void const struct sockaddr static tolen const char static pathname void static offset struct stat static buf void long static basep static whence static length const void static len static semflg const void static shmflg const struct timespec struct timespec static rem const char static group const void length
Declares methods and properties that enables a running checksum to be calculated