Beispiel #1
0
        /// Equals determines whether two files (buffers)
        /// have the same checksum value (identical).
        /// </summary>
        /// <param name="obj">A AdlerChecksum object for comparison</param>
        /// <returns>Returns true if the value of checksum is the same
        /// as this instance; otherwise, false
        /// </returns>
        public override bool Equals(object obj)
        {
            if (obj == null || this.GetType() != obj.GetType())
            {
                return(false);
            }

            AdlerChecksum other = (AdlerChecksum)obj;

            return(this.ChecksumValue == other.ChecksumValue);
        }
Beispiel #2
0
 public void InsertAdler32()
 {
     Array.Copy(BitConverter.GetBytes(AdlerChecksum.Generate(ref buffer, 6, length)), 0, buffer, 2, 4);
 }
Beispiel #3
0
 public bool CheckAdler32()
 {
     return(AdlerChecksum.Generate(ref buffer, 6, length) == GetAdler32());
 }