public static string GetCrc32String(byte[] buffer) { Crc32Hash crc32 = new Crc32Hash(); crc32.Append(buffer); byte[] retVal = crc32.Finish(); return(BitConverter.ToString(retVal).Replace("-", "")); }
/// <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()); }
/// <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("-", "")); }