예제 #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;
            }
        }
예제 #2
0
파일: CRC.cs 프로젝트: darekfilip/IDHT
 public static int getCRC(string inputString)
 {
     Crc32 crc = new Crc32();
     crc.ComputeHash(System.Text.ASCIIEncoding.ASCII.GetBytes(inputString));
     return (int)crc.CrcValue;
 }
예제 #3
0
 public static int CRC(byte[] bytes)
 {
     Crc32 crc32 = new Crc32();
     return BitConverter.ToInt32(crc32.ComputeHash(bytes), 0);
 }