V2/Cet/IO/Cet.IO/Hashing/HashCrc32.cs
/// <summary>
/// Calculate the hashing over a segment of a byte array
/// </summary>
/// <param name="buffer"></param>
/// <param name="offset"></param>
/// <param name="count"></param>
/// <returns></returns>
Calculate the hashing over a segment of a byte array
Calculate the hashing over a segment of a byte array
public override int Compute(
            byte[] buffer, 
            int offset, 
            int count)
        {
            uint crc = Seed;
            for (int i = 0; i < count; i++)
            {
                var temp = (byte)(buffer[offset + i] ^ crc);
                crc = (crc >> 8) ^ _table[temp];
            }
            return (int)(crc ^ 0xFFFFFFFF);
        }
public override int Compute ( byte [ ] buffer , int offset , int count ) { uint crc = Seed ; for ( int i = 0 ; i < count ; i ++ ) { var temp = ( byte ) ( buffer [ offset + i ] ^ crc ) ; crc = ( crc >> 8 ) ^ _table [ temp ] ; } return ( int ) ( crc ^ 0xFFFFFFFF ) ; }
Calculate the hashing over a segment of a byte array
Calculate the hashing over a segment of a byte array
None
buffer
byte[]
None
offset
int
None
count
int
None