{"id":16592454,"url":"https://github.com/hauleth/bare-erlang","last_synced_at":"2026-05-26T13:40:39.545Z","repository":{"id":140294570,"uuid":"311299646","full_name":"hauleth/bare-erlang","owner":"hauleth","description":"Implementation of BARE encoding in Erlang (mirror)","archived":false,"fork":false,"pushed_at":"2020-11-17T19:19:35.000Z","size":15,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-17T01:43:02.430Z","etag":null,"topics":["bare","baremessages","erlang","serialization"],"latest_commit_sha":null,"homepage":"https://git.sr.ht/~hauleth/BARE-Erlang","language":"Erlang","has_issues":false,"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/hauleth.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-09T10:18:14.000Z","updated_at":"2022-03-14T19:59:28.000Z","dependencies_parsed_at":null,"dependency_job_id":"5200b358-1370-4f7f-ba2c-53af6fa83d12","html_url":"https://github.com/hauleth/bare-erlang","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/hauleth%2Fbare-erlang","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hauleth%2Fbare-erlang/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hauleth%2Fbare-erlang/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hauleth%2Fbare-erlang/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hauleth","download_url":"https://codeload.github.com/hauleth/bare-erlang/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242241245,"owners_count":20095339,"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":["bare","baremessages","erlang","serialization"],"created_at":"2024-10-11T23:20:57.532Z","updated_at":"2026-05-26T13:40:39.496Z","avatar_url":"https://github.com/hauleth.png","language":"Erlang","funding_links":[],"categories":[],"sub_categories":[],"readme":"BARE\n=====\n\n[![builds.sr.ht status](https://builds.sr.ht/~hauleth/BARE-Erlang.svg)](https://builds.sr.ht/~hauleth/BARE-Erlang?)\n[![Hex version](https://img.shields.io/hexpm/v/bare)](https://hex.pm/packages/bare)\n\nImplementation of [BARE][] encoding in Erlang.\n\n## Usage\n\n```erlang\nSpec = {struct, [{name, string}, {age, uint}]},\n\nBinary = bare:encode(#{name =\u003e \"hauleth\", age =\u003e 28}, Spec),\n#{name =\u003e \u003c\u003c\"hauleth\"\u003e\u003e, age =\u003e 28} = bare:decode(Binary, Spec)\n```\n\n### Types\n\n```\n| BARE name         | Spec format                    | Erlang type                                      |\n| :                 | :                              | :                                                |\n| `uint`            | `uint`                         | `non_neg_integer()`                              |\n| `int`             | `int`                          | `integer()`                                      |\n| `u8`              | `u8`                           | `non_neg_integer()`                              |\n| `u16`             | `u16`                          | `non_neg_integer()`                              |\n| `u32`             | `u32`                          | `non_neg_integer()`                              |\n| `u64`             | `u64`                          | `non_neg_integer()`                              |\n| `i8`              | `i8`                           | `integer()`                                      |\n| `i16`             | `i16`                          | `integer()`                                      |\n| `i32`             | `i32`                          | `integer()`                                      |\n| `i64`             | `i64`                          | `integer()`                                      |\n| `f32`             | `f32`                          | float or `qnan`/`snan`/`infinity`/`neg_infinity` |\n| `f64`             | `f64`                          | float or `qnan`/`snan`/`infinity`/`neg_infinity` |\n| `string`          | `string`                       | `unicode:chardata()`                             |\n| `data`            | `data`                         | `binary()`                                       |\n| `data\u003cN\u003e`         | `{data, N}`                    | `binary()` with `byte_size(Bin) =:= N`           |\n| `void`            | `void`                         | `[]` (empty list)                                |\n| `enum`            | `{enum, [atom(), ...]`         | `atom()` that is listed in the spec              |\n| `optional\u003ctype\u003e`  | `{optional, Type}`             | `undefined` or one of the other types            |\n| `[size]type`      | `{array, Type, Size}`          | list of `type` that has exactly `Size` elements  |\n| `[]type`          | `{array, Type}`                | list of `type`                                   |\n| `map[key]type`    | `{map, KeyType, ValueType}`    | map in form of `#{KeyType =\u003e ValueType}`         |\n| `(type1 | type2)` | `{union, [Type1, Type2], ...}` | tuple in form of `{Type, Data}`                  |\n| `struct`          | `{struct, [{Key, Type}, ...]}` | map                                              |\n```\n\n## TODO\n\n- Implement compiler for BARE description files\n\n## License\n\n[Apache 2.0](LICENSE)\n\n[BARE]: https://baremessages.org\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhauleth%2Fbare-erlang","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhauleth%2Fbare-erlang","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhauleth%2Fbare-erlang/lists"}