namespace ICSharpCode.SharpZipLib.Checksum
{
	/// 
	/// Interface to compute a data checksum used by checked input/output streams.
	/// A data checksum can be updated by one byte or with a byte array. After each
	/// update the value of the current checksum can be returned by calling
	/// getValue. The complete checksum object can also be reset
	/// so it can be used again with new data.
	/// 
	public interface IChecksum
	{
		/// 
		/// Resets the data checksum as if no update was ever called.
		/// 
		void Reset();
		/// 
		/// Returns the data checksum computed so far.
		/// 
		long Value {
			get;
		}
		/// 
		/// Adds one byte to the data checksum.
		/// 
		/// 
		/// the data value to add. The high byte of the int is ignored.
		/// 
		void Update(int bval);
		/// 
		/// Updates the data checksum with the bytes taken from the array.
		/// 
		/// 
		/// buffer an array of bytes
		/// 
		void Update(byte[] buffer);
		/// 
		/// Adds the byte array to the data checksum.
		/// 
		/// 
		/// The buffer which contains the data
		/// 
		/// 
		/// The offset in the buffer where the data starts
		/// 
		/// 
		/// the number of data bytes to add.
		/// 
		void Update(byte[] buffer, int offset, int count);
	}
}