Documentation
¶
Overview ¶
Package hash contains the hash node: deterministic whole-property hashing with standard-library cryptographic hash algorithms.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Algorithm string `json:"algorithm"`
Source string `json:"source"`
Target string `json:"target"`
Encoding string `json:"encoding"`
}
Config holds the hash node configuration.
type Node ¶
Node hashes one configured message property into another.
func NewNode ¶
func NewNode(node nodestore.NodeInterface, cfg *Config) *Node
NewNode creates a hash node.
func (*Node) Execute ¶
func (n *Node) Execute(ctx context.Context, in nodestore.MessageInterface) (nodestore.MessageInterface, error)
Execute hashes the configured source property. Input byte semantics are deterministic: strings are UTF-8 bytes, []byte passes through unchanged, and objects/arrays use the compact deterministic JSON encoding provided by encoding/json (including sorted object keys). Non-JSON values are errors.