{"id":17991766,"url":"https://github.com/x2bool/serde_ub_json","last_synced_at":"2025-03-25T23:32:30.159Z","repository":{"id":58493968,"uuid":"527104522","full_name":"x2bool/serde_ub_json","owner":"x2bool","description":"UBJSON serialization for Rust using Serde","archived":false,"fork":false,"pushed_at":"2022-09-03T05:44:12.000Z","size":13,"stargazers_count":3,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-20T23:01:38.523Z","etag":null,"topics":["deserialization","json","rust","serde","serde-json","serialization","ubjson"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/x2bool.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-08-21T04:26:24.000Z","updated_at":"2023-05-18T03:33:23.000Z","dependencies_parsed_at":"2022-09-03T18:10:35.922Z","dependency_job_id":null,"html_url":"https://github.com/x2bool/serde_ub_json","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/x2bool%2Fserde_ub_json","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/x2bool%2Fserde_ub_json/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/x2bool%2Fserde_ub_json/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/x2bool%2Fserde_ub_json/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/x2bool","download_url":"https://codeload.github.com/x2bool/serde_ub_json/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245562298,"owners_count":20635897,"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":["deserialization","json","rust","serde","serde-json","serialization","ubjson"],"created_at":"2024-10-29T19:24:08.410Z","updated_at":"2025-03-25T23:32:27.671Z","avatar_url":"https://github.com/x2bool.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Serde UBJSON (Universal Binary JSON) ![Latest Version](https://img.shields.io/crates/v/serde_ub_json.svg)\n\n**serde_ub_json** is [UBJSON](https://ubjson.org) serialization format implementation for Rust/Serde\n\n# Why\n\nStructure: this format is structurally equivalent to JSON, and has the same set of data types (**numbers, booleans, strings, arrays and objects**).\n\nSize: null, true and false values are **75% smaller**, large numeric values are **~50% smaller**, array and object containers are **1-byte-per-value smaller**.\n\nParsing: boolean and numeric values are not encoded as strings - they are represented as bytes and do not require parsing, strings are byte arrays with length, which means they can always be safely deserialized as string slices without data copying.\n\n# How to install\n\n```shell\ncargo add serde_ub_json\n```\n\nOr add as a dependency in Cargo.toml:\n\n```toml\n[dependencies]\nserde_ub_json = \"0.1\"\n```\n\n# How to use\n\n```rust\nuse serde::{Deserialize, Serialize};\nuse serde_ub_json::{Result, to_bytes, from_bytes};\n\n//...\n\n#[derive(Serialize, Deserialize)]\nstruct Person {\n    name: String,\n    age: u8,\n}\n\n//...\n\nlet p = Person { name: \"John Doe\", age: 43 };\n\nlet bytes = to_bytes(\u0026p)?; // serialize\nlet person = from_bytes::\u003c'_, Person\u003e(\u0026bytes)?; // deserialize\n\nassert_eq!(p.name, person.name);\nassert_eq!(p.age, person.age);\n```\n\n# About\n\nThis projects aims to be a complete implementation of UBJSON standard.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fx2bool%2Fserde_ub_json","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fx2bool%2Fserde_ub_json","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fx2bool%2Fserde_ub_json/lists"}