internal uint AddToCRC32(ushort c) { byte octet = (byte)(c & 255); byte octet2 = (byte)(c >> 8); this._crc32 = Crc32.UPDC32(octet2, this._crc32); this._crc32 = Crc32.UPDC32(octet, this._crc32); return(~this._crc32); }
public static uint CRC32Bytes(byte[] bytes) { uint num = 4294967295u; int i = bytes.Length; int num2 = 0; while (i > 0) { i--; num = Crc32.UPDC32(bytes[i], num); num2++; } return(~num); }
public static uint CRC32String(string text) { uint num = 4294967295u; int i = text.Length; int num2 = 0; while (i > 0) { i--; ushort num3 = (ushort)text[i]; byte octet = (byte)(num3 & 255); byte octet2 = (byte)(num3 >> 8); num = Crc32.UPDC32(octet2, num); num = Crc32.UPDC32(octet, num); num2++; } return(~num); }