Table of Contents

Method Compute

Namespace
MailFathom.Application.Emails.Chunking
Assembly
MailFathom.Application.dll

Compute(EmailChunkingRules, bool, string)

Computes the identity of one chunk from its text and the rules that produced it.

public static EmailChunkContentHash Compute(EmailChunkingRules rules, bool isDerivedFromLossyHtml, string text)

Parameters

rules EmailChunkingRules

The boundary rules the chunk was cut to.

isDerivedFromLossyHtml bool

Whether the text the chunk came from was inferred from markup.

text string

The chunk's own text.

Returns

EmailChunkContentHash

The chunk's content hash.

Remarks

Every text field is length-prefixed and every number is written big-endian, so the encoding is one-to-one and the digest depends on the values alone rather than on the machine that computed it. The lossy-HTML marker is covered as well as the rules: a passage read from markup and the same passage read from a plain-text part are worth different amounts to a later ranking, so they are not one chunk under two names.

Exceptions

ArgumentNullException

Thrown when rules or text is null.