Expand description
JSON output formatting for magic rule evaluation results
This module provides JSON-specific data structures and formatting functions for outputting magic rule evaluation results in a structured format compatible with the original libmagic specification.
The JSON output format follows the original spec with fields for text, offset, value, tags, and score, providing a machine-readable alternative to the human-readable text output format.
Structs§
- Json
Line Output - JSON Lines output structure with filename and matches
- Json
Match Result - JSON representation of a magic rule match result
- Json
Output - JSON output structure containing an array of matches
Functions§
- format_
json_ line_ output - Format match results as JSON Lines output string
- format_
json_ output - Format match results as JSON output string
- format_
json_ output_ compact - Format match results as compact JSON output string
- format_
value_ as_ hex - Format a Value as a hexadecimal string for JSON output