<PackageReference Include="Azure.Storage.Blobs" Version="12.30.0-beta.1" />

Azure.Storage.ContentHasher

static class ContentHasher
Hashes Storage content.
public sealed delegate GetFinalStreamHash : MulticastDelegate

public static Task<ValueTuple<Stream, GetHashResult, string, long?>> ApplyUploadEncodingInternal(Stream content, UploadTransferValidationOptions validationOptions, bool allowStructuredMessage, IProgress<long> progressHandler, bool async, CancellationToken cancellationToken)

Applies structured message encoding or content hashing for upload operations, then attaches the progress handler to the content stream. When allowStructuredMessage is true and validationOptions requests CRC64, the content is wrapped in a structured message encoding stream and progress is reported in terms of the original (unencoded) byte count. Otherwise the content hash is computed before the progress handler is attached.

public static void AssertResponseHashMatch(byte[] content, int offset, int count, StorageChecksumAlgorithm algorithm, Response response)

Asserts the content of the given array match the response content hash.

public static Task AssertResponseHashMatchInternal(Stream content, StorageChecksumAlgorithm algorithm, Response response, bool async, CancellationToken cancellationToken)

Asserts the content of the given stream match the response content hash.

public static GetHashResult GetHash(BinaryData content, StorageChecksumAlgorithm algorithmIdentifier)

Computes the requested hash, if desired.

public static IHasher GetHasherFromAlgorithmId(StorageChecksumAlgorithm algorithm)

public static Task<GetHashResult> GetHashInternal(Stream content, StorageChecksumAlgorithm algorithmIdentifier, bool async, CancellationToken cancellationToken)

Computes the requested hash, if desired.

public static GetHashResult GetHashOrDefault(BinaryData content, UploadTransferValidationOptions options)

Computes the requested hash for an upload operation, or default.

public static Task<GetHashResult> GetHashOrDefaultInternal(Stream content, UploadTransferValidationOptions options, bool async, CancellationToken cancellationToken)

Computes the requested hash for an upload operation, or default.

public static ValueTuple<ReadOnlyMemory<byte>, StorageChecksumAlgorithm> GetResponseChecksumOrDefault(Response response)

public static ValueTuple<Stream, GetFinalStreamHash, int, IDisposable> SetupChecksumCalculatingReadStream(Stream stream, StorageChecksumAlgorithm algorithmIdentifier)