Skip to content

Commit

Permalink
dropped 'NonCryptographic' from crc class name (#27458)
Browse files Browse the repository at this point in the history
  • Loading branch information
jaschrep-msft authored Mar 10, 2022
1 parent 95926ae commit 00bd090
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ public enum ClientSideEncryptionVersion
{
V1_0 = 1,
}
public partial class StorageCrc64NonCryptographicHashAlgorithm : System.IO.Hashing.NonCryptographicHashAlgorithm
public partial class StorageCrc64HashAlgorithm : System.IO.Hashing.NonCryptographicHashAlgorithm
{
internal StorageCrc64NonCryptographicHashAlgorithm() : base (default(int)) { }
internal StorageCrc64HashAlgorithm() : base (default(int)) { }
public override void Append(System.ReadOnlySpan<byte> source) { }
public static Azure.Storage.StorageCrc64NonCryptographicHashAlgorithm Create() { throw null; }
public static Azure.Storage.StorageCrc64HashAlgorithm Create() { throw null; }
protected override void GetCurrentHashCore(System.Span<byte> destination) { }
public override void Reset() { }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ internal class NonCryptographicHashAlgorithmHasher : IHasher
{
private const int _streamBufferSize = 4 * Constants.MB;

private readonly StorageCrc64NonCryptographicHashAlgorithm _nonCryptpgraphicHashAlgorithm;
private readonly StorageCrc64HashAlgorithm _nonCryptographicHashAlgorithm;

public NonCryptographicHashAlgorithmHasher(StorageCrc64NonCryptographicHashAlgorithm nonCryptographicHashAlgorithm)
public NonCryptographicHashAlgorithmHasher(StorageCrc64HashAlgorithm nonCryptographicHashAlgorithm)
{
_nonCryptpgraphicHashAlgorithm = nonCryptographicHashAlgorithm;
_nonCryptographicHashAlgorithm = nonCryptographicHashAlgorithm;
}

public byte[] ComputeHash(Stream stream)
Expand All @@ -37,12 +37,12 @@ public byte[] ComputeHash(Stream stream)
break;
}

_nonCryptpgraphicHashAlgorithm.Append(new ReadOnlySpan<byte>(buffer, 0, read));
_nonCryptographicHashAlgorithm.Append(new ReadOnlySpan<byte>(buffer, 0, read));
}

ArrayPool<byte>.Shared.Return(buffer);

return _nonCryptpgraphicHashAlgorithm.GetCurrentHash();
return _nonCryptographicHashAlgorithm.GetCurrentHash();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,24 @@ namespace Azure.Storage
/// <summary>
/// Azure Storage CRC-64 implementation.
/// </summary>
public class StorageCrc64NonCryptographicHashAlgorithm : NonCryptographicHashAlgorithm
public class StorageCrc64HashAlgorithm : NonCryptographicHashAlgorithm
{
private ulong _uCRC;
private const int _hashSizeBytes = 8;

private StorageCrc64NonCryptographicHashAlgorithm(ulong uCrc)
private StorageCrc64HashAlgorithm(ulong uCrc)
: base(_hashSizeBytes)
{
_uCRC = uCrc;
}

/// <summary>
/// Creates a new instance of <see cref="StorageCrc64NonCryptographicHashAlgorithm"/>.
/// Creates a new instance of <see cref="StorageCrc64HashAlgorithm"/>.
/// </summary>
/// <returns></returns>
public static StorageCrc64NonCryptographicHashAlgorithm Create()
public static StorageCrc64HashAlgorithm Create()
{
return new StorageCrc64NonCryptographicHashAlgorithm(0UL);
return new StorageCrc64HashAlgorithm(0UL);
}

/// <inheritdoc/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public void UpdateHashManualAppends()
// should produce same result every time regardless of randomness
byte[] ComputeHash()
{
var calculator = StorageCrc64NonCryptographicHashAlgorithm.Create();
var calculator = StorageCrc64HashAlgorithm.Create();
var position = 0;

do
Expand Down

0 comments on commit 00bd090

Please sign in to comment.