Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Class

OfficeDocumentAssetHash

OfficeIMO.Reader

Namespace
OfficeIMO.Reader
Assembly
OfficeIMO.Reader.Core
Source revision
e163ccb36643 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) #

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

Parameters

stream System.IO.Stream required
cancellationToken System.Threading.CancellationToken = default optional

Returns

string
public static string ComputeSha256Hex(byte[] payload) #

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

Parameters

payload byte[] required
Asset payload bytes.

Returns

string
public static bool PayloadHashMatches(OfficeDocumentAsset asset, out string? actualHash) #

Checks whether an asset payload matches its declared payload hash.

Parameters

asset OfficeIMO.Reader.OfficeDocumentAsset required
Asset to validate.
actualHash string? required
Computed SHA-256 hash when validation could run.

Returns

bool