Class
OfficeDocumentAssetHash
OfficeIMO.Reader
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
- cancellationToken System.Threading.CancellationToken = default
Returns
stringpublic static string ComputeSha256Hex(byte[] payload) #Computes a lowercase SHA-256 hex hash for asset payload bytes.
Parameters
- payload byte[]
- Asset payload bytes.
Returns
stringpublic static bool PayloadHashMatches(OfficeDocumentAsset asset, out string? actualHash) #Checks whether an asset payload matches its declared payload hash.
Parameters
- asset OfficeIMO.Reader.OfficeDocumentAsset
- Asset to validate.
- actualHash string?
- Computed SHA-256 hash when validation could run.
Returns
bool