Пример #1
0
        public bool CheckAdler32()
        {
            if (Client.VersionNumber >= 831 && AdlerChecksum.Generate(ref buffer, 6, length) != GetAdler32())
            {
                return(false);
            }

            return(true);
        }
Пример #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);
        }
Пример #3
0
 public void AddAdler32()
 {
     Array.Copy(BitConverter.GetBytes(AdlerChecksum.Generate(ref buffer, 6, length)), 0, buffer, 2, 4);
 }