Exemplo n.º 1
0
        public bool CheckAdler32()
        {
            if (AdlerChecksum.Generate(ref buffer, 6, length) != GetAdler32())
            {
                return(false);
            }

            return(true);
        }
Exemplo n.º 2
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);
        }
Exemplo n.º 3
0
 public void AddAdler32()
 {
     Array.Copy(BitConverter.GetBytes(AdlerChecksum.Generate(ref buffer, 6, length)), 0, buffer, 2, 4);
 }