/// <summary> /// Returns the CRC32 (Cyclic redundancy check) hash for the specified <see cref="byte"/> array. /// </summary> /// <param name="b"></param> /// <returns></returns> public static uint CRC32(byte[] b) { using var ms = new MemoryStream(b); var crypt = new Argus.IO.Compression.CRC32(); return(crypt.GetCrc32(ms)); }
/// <summary> /// Returns the CRC32 (Cyclic redundancy check) hash for the specified <see cref="string"/>. /// </summary> /// <param name="str"></param> /// <param name="enc"></param> public static uint CRC32(string str, Encoding enc) { using var ms = str.ToMemoryStream(enc); var crypt = new Argus.IO.Compression.CRC32(); return(crypt.GetCrc32(ms)); }
/// <summary> /// Returns the CRC32 (Cyclic redundancy check) hash for the specified <see cref="Stream"/>. /// </summary> /// <param name="s"></param> public static uint CRC32(Stream s) { var crypt = new Argus.IO.Compression.CRC32(); return(crypt.GetCrc32(s)); }