Simias::Sync::Delta::WeakHash Class Reference

Class to compute a weak hash for a block of data. The hash can be calculated quickly, and can be rolled. That is recaculated as the window is slid one byte at a time through a buffer. More...

List of all members.

Public Member Functions

UInt32 ComputeHash (byte[] buffer, int offset, UInt16 count)
 Computes the weak hash for a block of data.
UInt32 RollHash (int count, byte dropValue, byte addValue)
 Recalculates the weak hash droping the dropvalue and including the addValue.


Detailed Description

Class to compute a weak hash for a block of data. The hash can be calculated quickly, and can be rolled. That is recaculated as the window is slid one byte at a time through a buffer.


Member Function Documentation

UInt32 Simias::Sync::Delta::WeakHash::ComputeHash ( byte[]  buffer,
int  offset,
UInt16  count 
) [inline]

Computes the weak hash for a block of data.

Parameters:
buffer The buffer containing the data.
offset The offset in the block to start.
count The number of bytes to include in the hash.
Returns:
The weak hash code.

UInt32 Simias::Sync::Delta::WeakHash::RollHash ( int  count,
byte  dropValue,
byte  addValue 
) [inline]

Recalculates the weak hash droping the dropvalue and including the addValue.

Parameters:
count 
dropValue The byte to drop from the hash. This byte was at the begining of the last hash.
addValue The byte to add to the hash. This byte was one byte past the last hash block.
Returns:
The weak hash code.


The documentation for this class was generated from the following file:

Generated on Wed Apr 8 14:57:56 2009 for simias by  doxygen 1.5.6