{"id":16963622,"url":"https://github.com/coderobe/base65536-ruby","last_synced_at":"2026-03-14T09:35:26.357Z","repository":{"id":56842794,"uuid":"50752161","full_name":"coderobe/base65536-ruby","owner":"coderobe","description":"Unicode's answer to Base64, in Ruby","archived":false,"fork":false,"pushed_at":"2016-02-01T18:16:35.000Z","size":27,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-05-01T14:30:46.018Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/coderobe.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}},"created_at":"2016-01-31T00:39:30.000Z","updated_at":"2020-05-27T07:23:20.000Z","dependencies_parsed_at":"2022-09-14T17:42:56.218Z","dependency_job_id":null,"html_url":"https://github.com/coderobe/base65536-ruby","commit_stats":null,"previous_names":["nightbug/base65536-ruby"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderobe%2Fbase65536-ruby","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderobe%2Fbase65536-ruby/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderobe%2Fbase65536-ruby/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coderobe%2Fbase65536-ruby/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/coderobe","download_url":"https://codeload.github.com/coderobe/base65536-ruby/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248489971,"owners_count":21112667,"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-10-13T23:25:29.581Z","updated_at":"2026-03-14T09:35:26.312Z","avatar_url":"https://github.com/coderobe.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# base65536-ruby\n\n[Base64](https://en.wikipedia.org/wiki/Base64) is used to encode arbitrary binary data as \"plain\"\ntext using a small, extremely safe repertoire of 64 (well, 65) characters. Base64 remains highly\nsuited to text systems where the range of characters available is very small -- i.e., anything\nstill constrained to plain ASCII. Base64 encodes 6 bits, or 3/4 of an octet, per character.\n\nHowever, now that Unicode rules the world, the range of characters which can be considered \"safe\"\nin this way is, in many situations, significantly wider. Base65536 applies the same basic\nprinciple to a carefully-chosen repertoire of 65,536 (well, 65,792) Unicode code points, encoding\n16 bits, or 2 octets, per character. This allows up to 280 octets of binary data to fit in a\nTweet.\n\nIn theory, this project could have been a one-liner. In practice, naively taking each pair of\nbytes and smooshing them together to make a single code point is a bad way to do this because you\nend up with:\n\n* Control characters\n* Whitespace\n* Unpaired surrogate pairs\n* Normalization corruption\n* No way to tell whether the final byte in the sequence was there in the original or not\n\nFor details of how these code points were chosen and why they are thought to be safe,\n[see the project `base65536gen`](https://github.com/ferno/base65536gen).\n\n## Known Bugs\n\nApparently our Ruby implementation does not work with binary, yet the original library in JavaScript does. Needs some investigation, but it seems that buffer handling is severily different between those two languages.\n\nA temporarily fix to work with binary data is to encode them to plaintext based methods (e.g. Base64) and then to Base65536.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoderobe%2Fbase65536-ruby","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcoderobe%2Fbase65536-ruby","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoderobe%2Fbase65536-ruby/lists"}