Skip to main content

canonical_json

Function canonical_json 

Source
pub fn canonical_json(value: &Value) -> Result<Vec<u8>, ValidationError>
Expand description

Canonical JSON encoding used under every Cloud signature.

UTF-8, no insignificant whitespace, object keys sorted by their UTF-8 bytes at every depth, strings escaped as serde_json does (only ", \ and control characters are escaped; \b \f \n \r \t use the short form, other control characters \u00xx with lowercase hex; non-ASCII stays raw UTF-8), integers in plain decimal. Non-integer numbers are refused so that two implementations cannot disagree on float formatting.