wasSharpNET
/Cryptography/SHA1.cs |
@@ -38,11 +38,21 @@ |
/// </summary> |
/// <param name="sha1">the SHA1 hash object</param> |
/// <param name="data">the memorystream to compute the hash from</param> |
public static string ToHex(this System.Security.Cryptography.SHA1 sha1, MemoryStream data) |
public static string ToHex(this System.Security.Cryptography.SHA1 sha1, Stream data) |
{ |
return BitConverter.ToString(sha1.ComputeHash(data)).Replace("-", ""); |
} |
|
/// <summary> |
/// Return a 40 character hex representation of a SHA1 hash. |
/// </summary> |
/// <param name="sha1">the SHA1 hash object</param> |
/// <param name="data">a filestream to read the file from</param> |
public static string ToHex(this System.Security.Cryptography.SHA1 sha1, FileStream data) |
{ |
return BitConverter.ToString(sha1.ComputeHash(data)).Replace("-", ""); |
} |
|
/////////////////////////////////////////////////////////////////////////// |
// Copyright (C) Wizardry and Steamworks 2014 - License: GNU GPLv3 // |
/////////////////////////////////////////////////////////////////////////// |