mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
🐛Fix static method on hashes not being declared as such.
This commit is contained in:
@@ -96,10 +96,11 @@ namespace DiscImageChef.Checksums
|
||||
/// Gets the hash of a file
|
||||
/// </summary>
|
||||
/// <param name="filename">File path.</param>
|
||||
public byte[] File(string filename)
|
||||
public static byte[] File(string filename)
|
||||
{
|
||||
FileStream fileStream = new FileStream(filename, FileMode.Open);
|
||||
byte[] result = sha1Provider.ComputeHash(fileStream);
|
||||
SHA1 localSha1Provider = SHA1.Create();
|
||||
FileStream fileStream = new FileStream(filename, FileMode.Open);
|
||||
byte[] result = localSha1Provider.ComputeHash(fileStream);
|
||||
fileStream.Close();
|
||||
return result;
|
||||
}
|
||||
@@ -109,11 +110,12 @@ namespace DiscImageChef.Checksums
|
||||
/// </summary>
|
||||
/// <param name="filename">File path.</param>
|
||||
/// <param name="hash">Byte array of the hash value.</param>
|
||||
public string File(string filename, out byte[] hash)
|
||||
public static string File(string filename, out byte[] hash)
|
||||
{
|
||||
FileStream fileStream = new FileStream(filename, FileMode.Open);
|
||||
hash = sha1Provider.ComputeHash(fileStream);
|
||||
StringBuilder sha1Output = new StringBuilder();
|
||||
SHA1 localSha1Provider = SHA1.Create();
|
||||
FileStream fileStream = new FileStream(filename, FileMode.Open);
|
||||
hash = localSha1Provider.ComputeHash(fileStream);
|
||||
StringBuilder sha1Output = new StringBuilder();
|
||||
|
||||
foreach(byte h in hash) sha1Output.Append(h.ToString("x2"));
|
||||
|
||||
@@ -128,9 +130,10 @@ namespace DiscImageChef.Checksums
|
||||
/// <param name="data">Data buffer.</param>
|
||||
/// <param name="len">Length of the data buffer to hash.</param>
|
||||
/// <param name="hash">Byte array of the hash value.</param>
|
||||
public string Data(byte[] data, uint len, out byte[] hash)
|
||||
public static string Data(byte[] data, uint len, out byte[] hash)
|
||||
{
|
||||
hash = sha1Provider.ComputeHash(data, 0, (int)len);
|
||||
SHA1 localSha1Provider = SHA1.Create();
|
||||
hash = localSha1Provider.ComputeHash(data, 0, (int)len);
|
||||
StringBuilder sha1Output = new StringBuilder();
|
||||
|
||||
foreach(byte h in hash) sha1Output.Append(h.ToString("x2"));
|
||||
@@ -143,7 +146,7 @@ namespace DiscImageChef.Checksums
|
||||
/// </summary>
|
||||
/// <param name="data">Data buffer.</param>
|
||||
/// <param name="hash">Byte array of the hash value.</param>
|
||||
public string Data(byte[] data, out byte[] hash)
|
||||
public static string Data(byte[] data, out byte[] hash)
|
||||
{
|
||||
return Data(data, (uint)data.Length, out hash);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user