public static MD5 ( Stream streamToMD5 ) : string | ||
streamToMD5 | Stream | The bytes which will be checksummed |
return | string |
/// <summary> /// Return the MD5 hash of part of the current <see cref="ThreadSafeStream"/> as a string /// </summary> /// <param name="start">The start position in the stream</param> /// <param name="length">The length of stream to MD5</param> /// <returns></returns> public string MD5(long start, int length) { using (MemoryStream partialStream = new MemoryStream(length)) { lock (streamLocker) { StreamTools.Write(_innerStream, start, length, partialStream, 8000, 1000, 500); return(StreamTools.MD5(partialStream)); } } }
/// <summary> /// Return the MD5 hash of the current <see cref="ThreadSafeStream"/> as a string /// </summary> /// <returns></returns> public string MD5() { lock (streamLocker) return(StreamTools.MD5(_innerStream)); }