Ejemplo n.º 1
0
        protected static UInt32 ComputeFingerprint(byte[] bytes, int length)
        {
            // Length correction is requred like in ComputeMessageIntegrity, but
            // I assume that Fingerprint is last item always. It's true in most cases.

            using (Crc32 crc32 = new Crc32())
            {
                crc32.ComputeHash(bytes, 0, length);

                return crc32.CrcValue ^ 0x5354554e;
            }
        }
Ejemplo n.º 2
0
 public static int getCRC(string inputString)
 {
     Crc32 crc = new Crc32();
     crc.ComputeHash(System.Text.ASCIIEncoding.ASCII.GetBytes(inputString));
     return (int)crc.CrcValue;
 }
Ejemplo n.º 3
0
 public static int CRC(byte[] bytes)
 {
     Crc32 crc32 = new Crc32();
     return BitConverter.ToInt32(crc32.ComputeHash(bytes), 0);
 }