Esempio n. 1
0
        public static string GetCrc32String(byte[] buffer)
        {
            Crc32Hash crc32 = new Crc32Hash();

            crc32.Append(buffer);
            byte[] retVal = crc32.Finish();
            return(BitConverter.ToString(retVal).Replace("-", ""));
        }
Esempio n. 2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="buffer"></param>
        /// <returns></returns>
        public static byte[] GetCrc32Bytes(byte[] buffer)
        {
            if (buffer == null)
            {
                throw new ArgumentNullException("buffer");
            }

            Crc32Hash crc32 = new Crc32Hash();

            crc32.Append(buffer);
            return(crc32.Finish());
        }
Esempio n. 3
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="buffer"></param>
        /// <returns></returns>
        public static string GetCrc32String(byte[] buffer)
        {
            if (buffer == null)
            {
                throw new ArgumentNullException("buffer");
            }

            Crc32Hash crc32 = new Crc32Hash();

            crc32.Append(buffer);
            byte[] retVal = crc32.Finish();
            return(BitConverter.ToString(retVal).Replace("-", ""));
        }