{"id":16124260,"url":"https://github.com/ahdinosaur/json-canon","last_synced_at":"2025-09-24T06:32:35.321Z","repository":{"id":163437207,"uuid":"638915003","full_name":"ahdinosaur/json-canon","owner":"ahdinosaur","description":"Serialize JSON into a canonical format.","archived":false,"fork":false,"pushed_at":"2023-05-23T10:37:55.000Z","size":171,"stargazers_count":16,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-11T06:34:54.493Z","etag":null,"topics":["canonical","jcs","json","json-serialization","rfc8785","serialization"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ahdinosaur.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-05-10T11:27:46.000Z","updated_at":"2024-02-06T05:22:40.000Z","dependencies_parsed_at":null,"dependency_job_id":"2b753a84-4f7f-409a-95a7-d662bd9f9b8f","html_url":"https://github.com/ahdinosaur/json-canon","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahdinosaur%2Fjson-canon","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahdinosaur%2Fjson-canon/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahdinosaur%2Fjson-canon/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ahdinosaur%2Fjson-canon/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ahdinosaur","download_url":"https://codeload.github.com/ahdinosaur/json-canon/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234053145,"owners_count":18772082,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["canonical","jcs","json","json-serialization","rfc8785","serialization"],"created_at":"2024-10-09T21:20:20.208Z","updated_at":"2025-09-24T06:32:29.967Z","avatar_url":"https://github.com/ahdinosaur.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `json-canon`\n\nSerialize JSON into a canonical format.\n\nSafe for generating a consistent cryptographic hash or signature across platforms.\n\nFollows [RFC8785: JSON Canonicalization Scheme (JCS)](https://tools.ietf.org/html/rfc8785)\n\n![JSON cannon](https://i.imgur.com/OdH7hw1.png)\n\n## Features\n\nThe JSON Canonicalization Scheme concept in a nutshell:\n\n- Serialization of primitive JSON data types using methods compatible with ECMAScript's `JSON.stringify()`\n- Lexicographic sorting of JSON `Object` properties in a *recursive* process\n- JSON `Array` data is also subject to canonicalization, *but element order remains untouched*\n\n## Serializers\n\n### JavaScript: [`json-canon`](./js/json-canon)\n\n[![npm version](https://img.shields.io/npm/v/json-canon.svg?style=flat-square)](https://www.npmjs.com/package/json-canon) [![download](https://img.shields.io/npm/dt/json-canon?style=flat-square)](https://www.npmjs.com/package/json-canon) [![ci status](https://img.shields.io/github/actions/workflow/status/ahdinosaur/json-canon/js.yml?branch=main\u0026style=flat-square)](https://github.com/ahdinosaur/json-canon/actions/workflows/js.yml)\n\n```js\nconst serialize = require('json-canon')\n\nconst json = {\n  from_account: \"543 232 625-3\",\n  to_account: \"321 567 636-4\",\n  amount: 500,\n  currency: \"USD\"\n}\n\nconsole.log(serialize(json))\n// {\"amount\":500,\"currency\":\"USD\",\"from_account\":\"543 232 625-3\",\"to_account\":\"321 567 636-4\"}\n```\n\n### Rust: [`json-canon`](./rust/json-canon)\n\n[![crates.io version](https://img.shields.io/crates/v/json-canon.svg?style=flat-square)](https://crates.io/crates/json-canon) [![download](https://img.shields.io/crates/d/json-canon.svg?style=flat-square)](https://crates.io/crates/json-canon) [![docs.rs docs](https://img.shields.io/badge/docs-latest-blue.svg?style=flat-square)](https://docs.rs/json-canon) [![ci status](https://img.shields.io/github/actions/workflow/status/ahdinosaur/json-canon/rust.yml?branch=main\u0026style=flat-square)](https://github.com/ahdinosaur/json-canon/actions/workflows/rust.yml)\n\n```rust\nuse json_canon::to_string;\nuse serde_json::json;\n\nlet data = json!({\n    \"from_account\": \"543 232 625-3\",\n    \"to_account\": \"321 567 636-4\",\n    \"amount\": 500,\n    \"currency\": \"USD\"\n});\n\nprintln!(\"{}\", to_string(\u0026data)?);\n// {\"amount\":500,\"currency\":\"USD\",\"from_account\":\"543 232 625-3\",\"to_account\":\"321 567 636-4\"}\n```\n\n## Fuzzers\n\n- JavaScript: [`json-canon-fuzz`](./js/json-canon-fuzz)\n\n## References\n\n- [`cyberphone/ietf-json-canon`](https://github.com/cyberphone/ietf-json-canon)\n- [`cyberphone/json-canonicalization`](https://github.com/cyberphone/json-canonicalization)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fahdinosaur%2Fjson-canon","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fahdinosaur%2Fjson-canon","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fahdinosaur%2Fjson-canon/lists"}