mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Naming fixes.
This commit is contained in:
@@ -40,16 +40,16 @@ namespace Aaru.Checksums
|
||||
/// <summary>Wraps up .NET MD5 implementation to a Init(), Update(), Final() context.</summary>
|
||||
public class Md5Context : IChecksum
|
||||
{
|
||||
readonly MD5 md5Provider;
|
||||
readonly MD5 _provider;
|
||||
|
||||
/// <summary>Initializes the MD5 hash provider</summary>
|
||||
public Md5Context() => md5Provider = MD5.Create();
|
||||
public Md5Context() => _provider = MD5.Create();
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>Updates the hash with data.</summary>
|
||||
/// <param name="data">Data buffer.</param>
|
||||
/// <param name="len">Length of buffer to hash.</param>
|
||||
public void Update(byte[] data, uint len) => md5Provider.TransformBlock(data, 0, (int)len, data, 0);
|
||||
public void Update(byte[] data, uint len) => _provider.TransformBlock(data, 0, (int)len, data, 0);
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>Updates the hash with data.</summary>
|
||||
@@ -60,19 +60,19 @@ namespace Aaru.Checksums
|
||||
/// <summary>Returns a byte array of the hash value.</summary>
|
||||
public byte[] Final()
|
||||
{
|
||||
md5Provider.TransformFinalBlock(new byte[0], 0, 0);
|
||||
_provider.TransformFinalBlock(new byte[0], 0, 0);
|
||||
|
||||
return md5Provider.Hash;
|
||||
return _provider.Hash;
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
/// <summary>Returns a hexadecimal representation of the hash value.</summary>
|
||||
public string End()
|
||||
{
|
||||
md5Provider.TransformFinalBlock(new byte[0], 0, 0);
|
||||
_provider.TransformFinalBlock(new byte[0], 0, 0);
|
||||
var md5Output = new StringBuilder();
|
||||
|
||||
foreach(byte h in md5Provider.Hash)
|
||||
foreach(byte h in _provider.Hash)
|
||||
md5Output.Append(h.ToString("x2"));
|
||||
|
||||
return md5Output.ToString();
|
||||
|
||||
Reference in New Issue
Block a user