{"id":21270643,"url":"https://github.com/timstr/chive","last_synced_at":"2026-02-23T09:31:48.608Z","repository":{"id":190854260,"uuid":"683474103","full_name":"timstr/chive","owner":"timstr","description":"A low-level type-safe binary serialization library with support for numbers, arrays, strings, and nested sub-archives.","archived":false,"fork":false,"pushed_at":"2024-08-31T20:42:39.000Z","size":15,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-30T23:46:07.303Z","etag":null,"topics":["rust","serialization"],"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/timstr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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,"zenodo":null}},"created_at":"2023-08-26T17:28:37.000Z","updated_at":"2024-08-31T20:42:43.000Z","dependencies_parsed_at":null,"dependency_job_id":"f437f2e2-f269-4b81-afde-b61b93cc003c","html_url":"https://github.com/timstr/chive","commit_stats":null,"previous_names":["timstr/serialization","timstr/chive"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/timstr/chive","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timstr%2Fchive","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timstr%2Fchive/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timstr%2Fchive/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timstr%2Fchive/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/timstr","download_url":"https://codeload.github.com/timstr/chive/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timstr%2Fchive/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29741138,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-23T07:44:07.782Z","status":"ssl_error","status_checked_at":"2026-02-23T07:44:07.432Z","response_time":90,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["rust","serialization"],"created_at":"2024-11-21T08:18:09.171Z","updated_at":"2026-02-23T09:31:48.582Z","avatar_url":"https://github.com/timstr.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# chive\n\nA low-level binary format serialization and deserialization library with support for integer and floating point values and arrays of values, UTF-8 strings, and nested sub-archives.\n\n```rust\nlet chive = Chive::with_chive_in(|mut chive_in| {\n    chive_in.u8(1);\n    chive_in.u16(2);\n    chive_in.array_slice_u8(\u0026[0, 1, 2, 3]);\n    chive_in.array_slice_u64(\u0026[10, 11, 12, 13]);\n    chive_in.string(\"Testing\");\n\n    chive_in.nest(|mut nested_chive_in| {\n        nested_chive_in.u8(3);\n        nested_chive_in.u16(4);\n        nested_chive_in.array_slice_u8(\u0026[20, 21, 22, 23]);\n        nested_chive_in.array_slice_u64(\u0026[30, 31, 32, 33]);\n    });\n\n    chive_in.u8(1);\n});\n\nlet raw_data = chive.into_vec();\n// use raw_data to save to file, send over network, encode as Base64, whatever\n```\n\nIndividual values are stored as a type tag followed by the binary value. For strings, arrays, and sub-archives, the length is also encoded between the type tag and the value. During deserialization, the type and length can be inspected without reading or consuming the following value to make runtime decisions about how to interpret the archive. Otherwise, during deserialization, strongly-typed values can be read eagerly and easily using the `Result\u003c\u003e`-based interface.\n\n```rust\nlet chive = Chive::load_from_file(\"path/to/file.dat\")?;\nlet chive_out = chive.chive_out()?;\nlet id = d.u16()?;\nlet values = chive_out.array_slice_u16()?;\nlet name = chive_out.string()?;\n{\n    let nested_chive_out = chive_out.nest()?;\n    let inner_values = nested_chive_out.array_slice_f32()?;\n}\n```\n\nArrays can be serialized and deserialized using iterators as well as slices and `Vec`.\n\n```rust\nfor i in chive_out.array_iter_u16()? {\n    println!(\"{}\", i);\n}\n\nchive_out.array_iter_u16(some_hash_map.keys().cloned());\n```\n\n## Features not included\n\n-   Versioning\n-   Named fields\n-   JSON / BSON / `serde` compatibility\n-   Compression\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimstr%2Fchive","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftimstr%2Fchive","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimstr%2Fchive/lists"}