MD5() public static method

Return the MD5 hash of the provided memory stream as a string. Stream position will be equal to the length of stream on return, this ensures the MD5 is consistent.
public static MD5 ( Stream streamToMD5 ) : string
streamToMD5 Stream The bytes which will be checksummed
return string
コード例 #1
0
ファイル: StreamTools.cs プロジェクト: BigFun123/Massive
 /// <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));
         }
     }
 }
コード例 #2
0
ファイル: StreamTools.cs プロジェクト: BigFun123/Massive
 /// <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));
 }