Expand description
Text tools (PLAN_v0.3.0 P4): JSON format, minify and validate with our own tokenizer, Base64 and URL (percent) encoding, and MD5, SHA-1 and SHA-256 hashes.
The editing tools work on every non-empty selection, or on the whole document when nothing is selected; each run is one undo step. Without a selection, blank space at the start and end of the document is left out (a final line break stays where it is). Text is encoded and hashed as UTF-8 with the document’s line endings, so a whole UTF-8 document hashes like its file; decoded line breaks become the editor’s.
Structs§
- Hashes
- Hashes of some text, as lowercase hex.
- Invalid
Json - Where the JSON in a document stops being valid.
- Json
Error - Where a JSON text stops being valid, and why.
Enums§
- Codec
- A text encoding for
Action::EncodeandAction::Decode.
Constants§
- MAX_
FORMAT_ DEPTH - Format JSON refuses deeper nesting (minifying and validating do not).
Functions§
- base64_
decode - Decodes Base64 in the standard or URL-safe alphabet. Spaces and line
breaks are skipped and the
=padding may be left out. - base64_
encode - Base64 with the standard alphabet and
=padding. - format_
json - One member or element per line, each level indented by
indent(a tab, orindent.widthspaces). Key order, number text and strings are kept exactly; only the whitespace between tokens changes. - hash_
selections - The hash tool’s text: the non-empty selections joined by line breaks (as a copy of them would be), or the whole document when nothing is selected. The flag says it was the whole document.
- hashes
- Hashes the UTF-8 bytes of
text, withendingfor every line break. - hex_
decode - Reads pairs of hex digits, skipping blanks and line breaks.
- hex_
encode - Two upper-case hex digits per byte.
- minify_
json - The JSON with no whitespace between its tokens.
- url_
decode - Decodes
%XXescapes; everything else,+included, is kept. - url_
encode - Percent-encodes every byte except the RFC 3986 unreserved characters.
- validate_
json - Checks that
textis one JSON value (with blank space around it). - validate_
json_ in - Checks the JSON in each selection, or the document when nothing is selected (Text Tools > Validate JSON). Not an edit.