{"id":13469393,"url":"https://github.com/sharksforarms/deku","last_synced_at":"2026-10-19T13:05:19.484Z","repository":{"id":37482016,"uuid":"248276860","full_name":"sharksforarms/deku","owner":"sharksforarms","description":"Declarative binary reading and writing: bit-level, symmetric, serialization/deserialization","archived":false,"fork":false,"pushed_at":"2026-10-19T01:17:23.000Z","size":1696,"stargazers_count":1433,"open_issues_count":72,"forks_count":89,"subscribers_count":6,"default_branch":"master","last_synced_at":"2026-10-19T07:21:43.603Z","etag":null,"topics":["bits","bytes","declarative","deku","deserialization","encoder-decoder","parse","rust","rust-crate","serialization","symmetric"],"latest_commit_sha":null,"homepage":"","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/sharksforarms.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"accessibility":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","claude":null,"gemini":null,"cursor":null,"copilot":null,"dco":null,"cla":null,"disclosure":null},"funding":{"github":["sharksforarms","wcampbell0x2a"]}},"created_at":"2020-03-18T15:55:42.000Z","updated_at":"2026-10-18T18:21:58.000Z","dependencies_parsed_at":"2026-10-19T03:07:47.513Z","dependency_job_id":"cff407b0-149d-4587-9e76-884a91d6c81c","html_url":"https://github.com/sharksforarms/deku","commit_stats":{"total_commits":427,"total_committers":34,"mean_commits":"12.558823529411764","dds":0.5152224824355972,"last_synced_commit":"704f7c7198d2042b2a05badbe8792060d56c8f77"},"previous_names":[],"tags_count":36,"template":false,"template_full_name":null,"purl":"pkg:github/sharksforarms/deku","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sharksforarms%2Fdeku","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sharksforarms%2Fdeku/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sharksforarms%2Fdeku/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sharksforarms%2Fdeku/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sharksforarms","download_url":"https://codeload.github.com/sharksforarms/deku/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sharksforarms%2Fdeku/sbom","scorecard":{"id":64807,"data":{"date":"2025-08-04","repo":{"name":"github.com/sharksforarms/deku","commit":"257bbd21de07698770c9100f1a9d7b602dceb3bf"},"scorecard":{"version":"v5.2.1-28-gc1d103a9","commit":"c1d103a9bb9f635ec7260bf9aa0699466fa4be0e"},"score":5.8,"checks":[{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":10,"reason":"18 commit(s) and 9 issue activity found in the last 90 days -- score normalized to 10","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#maintained"}},{"name":"Code-Review","score":9,"reason":"Found 27/30 approved changesets -- score normalized to 9","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#binary-artifacts"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/coverage.yml:1","Warn: no topLevel permission defined: .github/workflows/main.yml:1","Warn: no topLevel permission defined: .github/workflows/pull_request.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/coverage.yml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/sharksforarms/deku/coverage.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/coverage.yml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/sharksforarms/deku/coverage.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/coverage.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/sharksforarms/deku/coverage.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/coverage.yml:25: update your workflow using https://app.stepsecurity.io/secureworkflow/sharksforarms/deku/coverage.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:49: update your workflow using https://app.stepsecurity.io/secureworkflow/sharksforarms/deku/main.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/main.yml:50: update your workflow using https://app.stepsecurity.io/secureworkflow/sharksforarms/deku/main.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:61: update your workflow using https://app.stepsecurity.io/secureworkflow/sharksforarms/deku/main.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/main.yml:62: update your workflow using https://app.stepsecurity.io/secureworkflow/sharksforarms/deku/main.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:72: update your workflow using https://app.stepsecurity.io/secureworkflow/sharksforarms/deku/main.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/main.yml:73: update your workflow using https://app.stepsecurity.io/secureworkflow/sharksforarms/deku/main.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/main.yml:76: update your workflow using https://app.stepsecurity.io/secureworkflow/sharksforarms/deku/main.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/sharksforarms/deku/main.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/main.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/sharksforarms/deku/main.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:38: update your workflow using https://app.stepsecurity.io/secureworkflow/sharksforarms/deku/main.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/main.yml:39: update your workflow using https://app.stepsecurity.io/secureworkflow/sharksforarms/deku/main.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/pull_request.yml:8: update your workflow using https://app.stepsecurity.io/secureworkflow/sharksforarms/deku/pull_request.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/pull_request.yml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/sharksforarms/deku/pull_request.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/pull_request.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/sharksforarms/deku/pull_request.yml/master?enable=pin","Info:   0 out of   7 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of  11 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE-APACHE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE-APACHE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 28 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/c1d103a9bb9f635ec7260bf9aa0699466fa4be0e/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-15T02:23:02.322Z","repository_id":37482016,"created_at":"2025-08-15T02:23:02.322Z","updated_at":"2025-08-15T02:23:02.322Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":344872684,"owners_count":38351112,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-10-03T21:59:58.778Z","status":"online","status_checked_at":"2026-10-19T02:00:06.414Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["bits","bytes","declarative","deku","deserialization","encoder-decoder","parse","rust","rust-crate","serialization","symmetric"],"created_at":"2024-07-31T15:01:37.324Z","updated_at":"2026-10-19T13:05:19.479Z","avatar_url":"https://github.com/sharksforarms.png","language":"Rust","funding_links":["https://github.com/sponsors/sharksforarms","https://github.com/sponsors/wcampbell0x2a"],"categories":["Rust","Language specific libraries","rust"],"sub_categories":[],"readme":"# Deku\n\nDeclarative binary reading and writing for Rust\n\n\u003ca href=\"https://crates.io/crates/deku\"\u003e\u003cimg src=\"https://img.shields.io/crates/v/deku.svg\" alt=\"Latest Version\"\u003e\u003c/a\u003e\n\u003ca href=\"https://docs.rs/deku\"\u003e\u003cimg src=\"https://docs.rs/deku/badge.svg\" alt=\"Rust Documentation\"\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/sharksforarms/deku/actions/workflows/main.yml\"\u003e\u003cimg src=\"https://github.com/sharksforarms/deku/actions/workflows/main.yml/badge.svg\" alt=\"CI Status\"\u003e\u003c/a\u003e\n\u003ca href=\"https://codecov.io/gh/sharksforarms/deku\"\u003e\u003cimg src=\"https://codecov.io/gh/sharksforarms/deku/branch/master/graph/badge.svg\" alt=\"codecov\"\u003e\u003c/a\u003e\n\nDescribe a binary layout with annotated structs and enums, then derive bit-level reading and\nwriting implementations from the same definition. It is designed for network\nprotocols, file formats, and embedded data.\n\n- Symmetric reading and writing from a single type definition\n- Designed for efficient binary reading and writing\n- Bit-sized fields with configurable byte and bit order\n- Tagged enums, variable-length collections, and conditional fields\n- Validation, context-aware types, and custom readers and writers\n- Byte slices and `Read`/`Write` streams\n- `std`, `no_std`, and fixed-size, no-allocation workflows with `DekuSize`\n\n## Usage\n\n*Compiler support: requires rustc 1.88+*\n\n```toml\n[dependencies]\ndeku = \"0.20\"\n```\n\n## Example\n\nThis example reads a red pixel in the 16-bit RGB565 format, adds blue, then\nwrites the resulting magenta pixel back to bytes.\n\n```rust\nuse deku::prelude::*;\n\n#[derive(Debug, PartialEq, DekuRead, DekuWrite)]\n#[deku(endian = \"big\")]\nstruct Rgb565 {\n    #[deku(bits = 5)]\n    red: u8,\n    #[deku(bits = 6)]\n    green: u8,\n    #[deku(bits = 5)]\n    blue: u8,\n}\n\nfn main() {\n    let input = [0xf8, 0x00];\n    let (_, mut pixel) = Rgb565::from_bytes((\u0026input, 0)).unwrap();\n\n    assert_eq!(pixel, Rgb565 { red: 31, green: 0, blue: 0 });\n\n    pixel.blue = 31;\n\n    let output = pixel.to_bytes().unwrap();\n    assert_eq!(output, [0xf8, 0x1f]);\n}\n```\n\nThe attributes describe the binary layout; `DekuRead` and `DekuWrite` generate\nthe matching operations in both directions.\n\nSee the [API documentation](https://docs.rs/deku),\n[`#[deku]` attribute reference](https://docs.rs/deku/latest/deku/attributes/),\nand [examples](https://github.com/sharksforarms/deku/tree/master/examples) for\ncomplete protocol layouts and more advanced use cases.\n\n## Cargo features\n\nThe default feature set selects `std`, `bits`, and `descriptive-errors`.\n`alloc` is enabled by both `std` and `descriptive-errors`.\n\n| Feature | Default | Description |\n| --- | --- | --- |\n| `std` | Yes | Standard library integration; also enables `alloc` |\n| `alloc` | Indirectly | Heap-backed types such as `Vec` and allocating APIs such as `to_bytes` |\n| `bits` | Yes | Bit-sized and non-byte-aligned fields, including `#[deku(bits = ...)]` |\n| `descriptive-errors` | Yes | Detailed, dynamically formatted error messages; requires `alloc` |\n| `logging` | No | Trace-level read and write diagnostics through the `log` crate |\n\nDeku supports `no_std` with or without allocation. Disable the default features\nfor a minimal no-allocation build:\n\n```toml\n[dependencies]\ndeku = { version = \"0.20\", default-features = false }\n```\n\nFeatures can be combined as needed. For example, enable `bits` for bit-level\nformats and `alloc` for heap-backed types:\n\n```toml\n[dependencies]\ndeku = { version = \"0.20\", default-features = false, features = [\"bits\", \"alloc\"] }\n```\n\n## Contributing\n\nSee the [contribution guide](https://github.com/sharksforarms/deku/blob/master/CONTRIBUTING.md)\nfor development, testing, linting, and CI instructions.\n\n## License\n\nLicensed under either the\n[MIT license](https://github.com/sharksforarms/deku/blob/master/LICENSE-MIT) or\n[Apache License 2.0](https://github.com/sharksforarms/deku/blob/master/LICENSE-APACHE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsharksforarms%2Fdeku","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsharksforarms%2Fdeku","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsharksforarms%2Fdeku/lists"}