Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/

API Reference

Class

OfficeDocumentAssetHash

Namespace OfficeIMO.Reader
Assembly OfficeIMO.Reader.Core
Source revision 02c4d39034ec with working tree changes
Modifiers static

Hash helpers for materializable read-result assets.

Inheritance

  • Object
  • OfficeDocumentAssetHash

Methods

ComputeSha256Hex 2 overloads
public static String ComputeSha256Hex(Stream stream, CancellationToken cancellationToken = default) #
Returns: String

Hashes the remaining stream bytes while observing cancellation. Leaves the stream open at the consumed position.

Parameters

stream System.IO.Stream requiredposition: 0
cancellationToken System.Threading.CancellationToken = default optionalposition: 1
public static String ComputeSha256Hex(Byte[] payload) #
Returns: String

Computes a lowercase SHA-256 hex hash for asset payload bytes.

Parameters

payload System.Byte[] requiredposition: 0
Asset payload bytes.
public static Boolean PayloadHashMatches(OfficeDocumentAsset asset, out String? actualHash) #
Returns: Boolean

Checks whether an asset payload matches its declared payload hash.

Parameters

asset OfficeIMO.Reader.OfficeDocumentAsset requiredposition: 0
Asset to validate.
actualHash System.String? requiredposition: 1
Computed SHA-256 hash when validation could run.