Table of Contents

Class RuleHasher

Namespace
RuleWright.Serialization
Assembly
RuleWright.Serialization.dll

Computes a stable content hash for a rule, used as the compiled-delegate cache key. The hash covers exactly the compilation-relevant content — the condition tree and actions — rendered in a canonical form (sorted keys, invariant number formatting). It is therefore insensitive to JSON whitespace, key order, and the layout, id, description, priority, and enabled members, none of which change the compiled delegate; any change to condition or action content changes the hash and invalidates the cache entry.

public static class RuleHasher
Inheritance
RuleHasher
Inherited Members

Methods

ComputeHash(Rule)

Computes the rule's content hash.

GetCanonicalForm(Rule)

Renders the rule's compilation-relevant content (condition and actions) as a canonical JSON string: fixed key order, invariant number formatting, no whitespace. Exposed for testability and diagnostics.