Class CanonicalJson
java.lang.Object
com.arc_e_tect.gradle.apionly.transcriberj.model.CanonicalJson
RFC 8785, the JSON Canonicalization Scheme, over the maps, lists and scalars a
YAML or JSON parser produces.
This is what makes a component's hash a property of its content rather than of how a bundler happened to format it.
-
Method Summary
-
Method Details
-
sha256
The lower-case hex SHA-256 of a value's canonical form, encoded as UTF-8.- Parameters:
value- a map, list, string, number, boolean ornull- Returns:
- the hash
-
write
A value's canonical form.- Parameters:
value- a map with string keys, list, string, number, boolean ornull- Returns:
- the canonical JSON text
- Throws:
IllegalArgumentException- for anything JSON cannot hold
-