{"id":19165449,"url":"https://github.com/mxjp/binary","last_synced_at":"2026-02-12T15:32:37.441Z","repository":{"id":57128335,"uuid":"436377008","full_name":"mxjp/binary","owner":"mxjp","description":"Utilities for binary data serialization \u0026 encoding","archived":false,"fork":false,"pushed_at":"2025-02-06T19:49:18.000Z","size":605,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-19T00:38:44.437Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/mxjp.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2021-12-08T20:03:31.000Z","updated_at":"2025-02-06T19:49:21.000Z","dependencies_parsed_at":"2024-11-27T14:47:02.004Z","dependency_job_id":null,"html_url":"https://github.com/mxjp/binary","commit_stats":{"total_commits":48,"total_committers":1,"mean_commits":48.0,"dds":0.0,"last_synced_commit":"816aecff01f70c6bfb76b665aff15d70eb819b5e"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mxjp%2Fbinary","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mxjp%2Fbinary/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mxjp%2Fbinary/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mxjp%2Fbinary/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mxjp","download_url":"https://codeload.github.com/mxjp/binary/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248070078,"owners_count":21042758,"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":[],"created_at":"2024-11-09T09:27:54.032Z","updated_at":"2026-02-12T15:32:32.404Z","avatar_url":"https://github.com/mxjp.png","language":"TypeScript","readme":"# @mpt/binary\nUtilities for binary data serialization \u0026 encoding\n\n# Installation\n```bash\nnpm i @mpt/binary\n```\n```ts\nimport { ... } from \"@mpt/binary\";\n```\n\n## Serialization / deserialization\n```ts\nconst data = new Serializer()\n    .uint8(42)\n    .prefixedUTF8(Serializer.prototype.uint16, \"Hello World!\")\n    .serialize();\n\n// data: Uint8Array { 2a 00 0c 48 65 6c 6c 6f 20 57 6f 72 6c 64 21 }\n\nconst deserializer = new Deserializer(data);\n\ndeserializer.uint8();\n// =\u003e 42\n\ndeserializer.utf8(deserializer.uint16());\n// =\u003e \"Hello World!\"\n```\n\n## Readable stream deserialization\n```ts\nconst res = await fetch(\"https://example.com/example-payload\");\n\nconst deserializer = new StreamDeserializer(res.body);\n\nawait deserializer.deserialize(d =\u003e {\n    return d.uint8();\n});\n// =\u003e 42\n\nawait deserializer.deserialize(d =\u003e {\n    return d.utf8(d.uint16());\n});\n// =\u003e \"Hello World!\"\n```\n\n## Encoding\n```ts\nencodeBase64(new TextEncoder().encode(\"Hello World!\"));\n// =\u003e \"SGVsbG8gV29ybGQh\"\n\nnew TextDecoder().decode(decodeBase64(\"SGVsbG8gV29ybGQh\"));\n// =\u003e \"Hello World!\"\n```\nSupported encodings:\n+ hex\n+ base64\n+ base64url\n+ base32 (encode only)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmxjp%2Fbinary","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmxjp%2Fbinary","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmxjp%2Fbinary/lists"}