9 using System.Runtime.InteropServices;
15 #region ChecksumGeneratorBase 42 _current = initialValue;
48 public void Reset() { _current = 0; }
74 Update(data, 0, data.Length);
84 Update(Encoding.UTF8.GetBytes(data));
92 public void Update(
string data, Encoding encoding)
94 Update(encoding.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 CRC32 checksum generator
GLenum GLuint GLenum GLsizei 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
abstract void Update(byte[] data, int offset, int count)
Updates the current checksum with part of an array of bytes
void Update(string data, Encoding encoding)
Updates the current checksum with the data from a string, using a specific encoding ...
ChecksumGeneratorBase()
Initializes a new instance of the checksum generator base - the current checksum is set to zero ...
void Update(byte[] data)
Updates the current checksum with an array of bytes.
override 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
CRC32Checksum(uint initialValue)
Initializes a new instance of the CRC32 checksum generator with a specified value ...
GLsizei GLsizei GLenum GLenum const GLvoid * data
uint Value
Gets the current checksum value
CRC32Checksum()
Initializes a new instance of the CRC32 checksum generator
unsigned long ZEXPORT crc32(unsigned long crc, const unsigned char FAR *buf, uInt len)
void Update(string data)
Updates the current checksum with the data from a string
uint _current
The value of the current checksum
Implements the common functionality needed for all ChecksumGenerators
Declares methods and properties that enables a running checksum to be calculated
Implements a checksum generator that computes the Adler checksum on data
ChecksumGeneratorBase(uint initialValue)
Initializes a new instance of the checksum generator basewith a specified value
GLuint GLuint GLsizei count
AdlerChecksum(uint initialValue)
Initializes a new instance of the Adler checksum generator with a specified value ...
uLong ZEXPORT adler32(uLong adler, const Bytef *buf, uInt len)