{"id":13399737,"url":"https://github.com/dmendel/bindata","last_synced_at":"2025-05-13T19:16:17.456Z","repository":{"id":8504653,"uuid":"10114632","full_name":"dmendel/bindata","owner":"dmendel","description":"BinData - Reading and Writing Binary Data in Ruby","archived":false,"fork":false,"pushed_at":"2025-04-11T06:07:09.000Z","size":1571,"stargazers_count":586,"open_issues_count":0,"forks_count":54,"subscribers_count":17,"default_branch":"master","last_synced_at":"2025-04-16T23:39:35.052Z","etag":null,"topics":["binary-analysis","declarative-language","file-format","reverse-engineering","ruby"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dmendel.png","metadata":{"files":{"readme":"README.md","changelog":"ChangeLog.rdoc","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":"2013-05-17T02:27:43.000Z","updated_at":"2025-04-11T06:06:12.000Z","dependencies_parsed_at":"2024-06-13T08:02:46.088Z","dependency_job_id":"ac4bbd41-c40c-457b-8e43-29cb11c4f198","html_url":"https://github.com/dmendel/bindata","commit_stats":{"total_commits":599,"total_committers":13,"mean_commits":46.07692307692308,"dds":0.4691151919866444,"last_synced_commit":"05510b472d49c89545bc7cd0b565f827f1700ce0"},"previous_names":[],"tags_count":33,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmendel%2Fbindata","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmendel%2Fbindata/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmendel%2Fbindata/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dmendel%2Fbindata/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dmendel","download_url":"https://codeload.github.com/dmendel/bindata/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250365285,"owners_count":21418663,"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":["binary-analysis","declarative-language","file-format","reverse-engineering","ruby"],"created_at":"2024-07-30T19:00:42.059Z","updated_at":"2025-04-26T04:25:26.134Z","avatar_url":"https://github.com/dmendel.png","language":"Ruby","readme":"# What is BinData?\n\n[![Github CI](https://github.com/dmendel/bindata/actions/workflows/ci.yml/badge.svg)](https://github.com/dmendel/bindata/actions/workflows/ci.yml)\n[![Version](https://img.shields.io/gem/v/bindata.svg)](https://rubygems.org/gems/bindata)\n[![Downloads](https://img.shields.io/gem/dt/bindata.svg)](https://rubygems.org/gems/bindata)\n[![Coverage](https://img.shields.io/coveralls/dmendel/bindata.svg)](https://coveralls.io/r/dmendel/bindata)\n\nDo you ever find yourself writing code like this?\n\n```ruby\nio = File.open(...)\nlen = io.read(2).unpack(\"v\")\nname = io.read(len)\nwidth, height = io.read(8).unpack(\"VV\")\nputs \"Rectangle #{name} is #{width} x #{height}\"\n```\n\nIt’s ugly, violates DRY and doesn't feel like Ruby.\n\nThere is a better way. Here’s how you’d write the above using BinData.\n\n```ruby\nclass Rectangle \u003c BinData::Record\n  endian :little\n  uint16 :len\n  string :name, :read_length =\u003e :len\n  uint32 :width\n  uint32 :height\nend\n\nio = File.open(...)\nr  = Rectangle.read(io)\nputs \"Rectangle #{r.name} is #{r.width} x #{r.height}\"\n```\n\nBinData provides a _declarative_ way to read and write structured binary data.\n\nThis means the programmer specifies *what* the format of the binary\ndata is, and BinData works out *how* to read and write data in this\nformat.  It is an easier (and more readable) alternative to\nruby's `#pack` and `#unpack` methods.\n\nBinData makes it easy to create new data types. It supports all the common\nprimitive datatypes that are found in structured binary data formats. Support\nfor dependent and variable length fields is built in. \n\n# Installation\n\n    $ gem install bindata\n\n# Documentation\n\n[BinData manual](http://github.com/dmendel/bindata/wiki).\n\n# Contact\n\nIf you have any queries / bug reports / suggestions, please contact me\n(Dion Mendel) via email at bindata@dmau.org\n","funding_links":[],"categories":["Similar projects / tools","Ruby"],"sub_categories":["CI"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdmendel%2Fbindata","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdmendel%2Fbindata","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdmendel%2Fbindata/lists"}