{"id":22286859,"url":"https://github.com/otake84/dlhn","last_synced_at":"2025-04-05T21:09:52.278Z","repository":{"id":57677767,"uuid":"315664126","full_name":"otake84/dlhn","owner":"otake84","description":"DLHN implementation for Rust","archived":false,"fork":false,"pushed_at":"2024-04-26T09:01:26.000Z","size":709,"stargazers_count":160,"open_issues_count":2,"forks_count":6,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-05-02T04:19:34.511Z","etag":null,"topics":["dlhn","rust","serde","serialization"],"latest_commit_sha":null,"homepage":"https://dlhn.org","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/otake84.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-11-24T14:53:23.000Z","updated_at":"2024-04-26T09:22:27.000Z","dependencies_parsed_at":"2024-04-26T08:31:53.834Z","dependency_job_id":"26692530-0fa7-4226-98e1-7951e2016dc2","html_url":"https://github.com/otake84/dlhn","commit_stats":{"total_commits":413,"total_committers":1,"mean_commits":413.0,"dds":0.0,"last_synced_commit":"95ede5f1a0a41ec30173fd36822c2a95d8e81e3e"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/otake84%2Fdlhn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/otake84%2Fdlhn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/otake84%2Fdlhn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/otake84%2Fdlhn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/otake84","download_url":"https://codeload.github.com/otake84/dlhn/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247399885,"owners_count":20932880,"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":["dlhn","rust","serde","serialization"],"created_at":"2024-12-03T16:58:22.857Z","updated_at":"2025-04-05T21:09:52.257Z","avatar_url":"https://github.com/otake84.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Latest Version](https://img.shields.io/crates/v/dlhn)](https://crates.io/crates/dlhn)\n[![Documentation](https://docs.rs/dlhn/badge.svg)](https://docs.rs/dlhn/)\n[![License](https://img.shields.io/github/license/otake84/dlhn)](LICENSE)\n\n# DLHN\nDLHN is a blazing fast and small data serialization format.  \n[Specification](https://dlhn.org)\n\n\u003cp align=\"center\"\u003e\u003ca href=\"https://dlhn.org/\" target=\"_blank\" alt=\"DLHN\"\u003e\u003cimg src=\"https://user-images.githubusercontent.com/1064585/166881107-9a386366-0ab9-4558-8b81-2a44a32df26c.png\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n## Overview\nDLHN ( Pronounced the same as \"Dullahan\" ) is a language and platform neutral binary serialization format that is inspired by JSON, CSV, MessagePack, and Protocol Buffers. It is designed for blazing fast serialization and deserialization with the smallest possible data size without the need for schema file.\nHowever, we are also considering supporting schema file in the future.\n\n## QuickStart\n```toml\n[dependencies]\ndlhn = \"0.1\"\n```\n\n## Serialize and deserialize body\n```rust\nuse dlhn::{Deserializer, Serializer};\nuse serde::{Deserialize, Serialize};\n\n#[derive(Serialize, Deserialize, PartialEq, Debug)]\nstruct Test {\n    a: bool,\n    b: u8,\n    c: String,\n}\n\nfn main() {\n    let body = Test {\n        a: true,\n        b: 123,\n        c: \"test\".to_string(),\n    };\n\n    // Serialize body\n    let mut output = Vec::new();\n    let mut serializer = Serializer::new(\u0026mut output);\n    body.serialize(\u0026mut serializer).unwrap();\n\n    // Deserialize body\n    let mut reader = output.as_slice();\n    let mut deserializer = Deserializer::new(\u0026mut reader);\n    let deserialized_body = Test::deserialize(\u0026mut deserializer).unwrap();\n\n    assert_eq!(body, deserialized_body);\n}\n```\n\n## Serialize and deserialize header\n```rust\nuse dlhn::{DeserializeHeader, SerializeHeader, Header};\n\n#[derive(SerializeHeader)]\nstruct Test {\n    a: bool,\n    b: u8,\n    c: String,\n}\n\nfn main() {\n    let mut output = Vec::new();\n\n    // Serialize header\n    Test::serialize_header(\u0026mut output).unwrap();\n    assert_eq!(\n        output,\n        [\n            21, // Tuple code\n            3,  // Tuple size\n            2,  // Boolean code\n            3,  // UInt8 code\n            18, // String code\n        ]\n    );\n\n    // Deserialize header\n    let deserialized_header = output.as_slice().deserialize_header().unwrap();\n    assert_eq!(\n        deserialized_header,\n        Header::Tuple(vec![Header::Boolean, Header::UInt8, Header::String])\n    );\n}\n```\n\n## Stream version serialize and deserialize bodies\n```rust\nuse dlhn::{de::Error, Deserializer, Serializer};\nuse serde::{Deserialize, Serialize};\n\nfn main() {\n    let mut output = Vec::new();\n\n    // Serialize body\n    let mut serializer = Serializer::new(\u0026mut output);\n    true.serialize(\u0026mut serializer).unwrap();\n    false.serialize(\u0026mut serializer).unwrap();\n    assert_eq!(output, [1, 0]);\n\n    // Deserialize body\n    let mut reader = output.as_slice();\n    let mut deserializer = Deserializer::new(\u0026mut reader);\n    assert_eq!(bool::deserialize(\u0026mut deserializer), Ok(true));\n    assert_eq!(bool::deserialize(\u0026mut deserializer), Ok(false));\n    assert_eq!(bool::deserialize(\u0026mut deserializer), Err(Error::Read));\n}\n```\n\n## Benchmark\n[Rust serialization benchmark](https://github.com/djkoloski/rust_serialization_benchmark)\n\n## Copyright\nCopyright 2020-2022 Shogo Otake\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fotake84%2Fdlhn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fotake84%2Fdlhn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fotake84%2Fdlhn/lists"}