{"id":17359116,"url":"https://github.com/nathanjhood/base32","last_synced_at":"2026-04-20T03:01:47.126Z","repository":{"id":216025262,"uuid":"740275069","full_name":"nathanjhood/base32","owner":"nathanjhood","description":" Base32 encode/decode with CLI and NodeJS Addon in C++.","archived":false,"fork":false,"pushed_at":"2024-01-08T06:50:13.000Z","size":49,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-27T15:29:30.206Z","etag":null,"topics":["base32","base32hex","cli","cmake","command-line-interface","cpp","javascript","node-addon-api","node-api","nodejs","typescript"],"latest_commit_sha":null,"homepage":"","language":"C++","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/nathanjhood.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":"2024-01-08T02:10:48.000Z","updated_at":"2024-01-08T16:38:10.000Z","dependencies_parsed_at":"2024-12-06T10:23:31.111Z","dependency_job_id":"acb6d071-602f-4da3-8fc1-4eea054808d6","html_url":"https://github.com/nathanjhood/base32","commit_stats":null,"previous_names":["nathanjhood/base32"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/nathanjhood/base32","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nathanjhood%2Fbase32","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nathanjhood%2Fbase32/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nathanjhood%2Fbase32/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nathanjhood%2Fbase32/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nathanjhood","download_url":"https://codeload.github.com/nathanjhood/base32/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nathanjhood%2Fbase32/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32031070,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-20T00:18:06.643Z","status":"online","status_checked_at":"2026-04-20T02:00:06.527Z","response_time":94,"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":["base32","base32hex","cli","cmake","command-line-interface","cpp","javascript","node-addon-api","node-api","nodejs","typescript"],"created_at":"2024-10-15T19:08:13.386Z","updated_at":"2026-04-20T03:01:47.095Z","avatar_url":"https://github.com/nathanjhood.png","language":"C++","readme":"# base32\n\nBase32 encode/decode CLI in C++.\n\n```.sh\n$ base32 [OPTIONS] [FILE]...\n```\n\nBase32 encode/decode functions in NodeJs.\n\n```.js\nimport base32 from \"@nathanjhood/base32\";\n\nconsole.log(base32.encode(\"foobar\"));\n```\n\n## Coming soon\n\n*PLEASE NOTE: This project is under construction; as of writing, the encode function is working but missing a few chars on longer strings. The decode function is actually the base64 decode algorithm as a plaeholder; this function will be ported to base32 shortly. Stay tuned!*\n\n## About\n\nThe encoding process represents 40-bit groups of input bits as output\nstrings of 8 encoded characters.  Proceeding from left to right, a\n40-bit input group is formed by concatenating 5 8bit input groups.\nThese 40 bits are then treated as 8 concatenated 5-bit groups, each\nof which is translated into a single character in the base 32\nalphabet.\n\n```.txt\n  \u003c===========\u003e                                                                   1st character\n                  \u003c===========\u003e                                                   2nd character\n                                  \u003c===========\u003e                                   3rd character\n                                                  \u003c===========\u003e                   4th character\n                                                                  \u003c===========\u003e   5th character\n+---------------+---------------+---------------+---------------+---------------+\n| \u003c     1     \u003e | \u003c     2     \u003e | \u003c     3     \u003e | \u003c     4     \u003e | \u003c     5     \u003e | 5 groups (8 bits)\n+---------------+---------------+---------------+---------------+---------------+\n|0 1 2 3 4 5 6 7|8 9 0 1 2 3 4 5|6 7 8 9 0 1 2 3|4 5 6 7 8 9 0 1|2 3 4 5 6 7 8 9| Stream  (40 bits)\n+---------+-----+---+---------+-+-------+-------+-+---------+---+-----+---------+\n|\u003c   1   \u003e|\u003c   2   \u003e|\u003c   3   \u003e|\u003c   4   \u003e|\u003c   5   \u003e|\u003c   6   \u003e|\u003c   7   \u003e|\u003c   8   \u003e| 8 groups (5 bits)\n+---------+---------+---------+---------+---------+---------+---------+---------+\n|5 4 3 2 1|5 4 3 2 1|5 4 3 2 1|5 4 3 2 1|5 4 3 2 1|5 4 3 2 1|5 4 3 2 1|5 4 3 2 1| Index   (40 bits)\n\n                                                                       \u003c=======\u003e  8th character\n                                                             \u003c=======\u003e            7th character\n                                                   \u003c=======\u003e                      6th character\n                                         \u003c=======\u003e                                5th character\n                               \u003c=======\u003e                                          4th character\n                     \u003c=======\u003e                                                    3rd character\n           \u003c=======\u003e                                                              2nd character\n \u003c=======\u003e                                                                        1st character\n```\n\nEach 5-bit group is used as an index into an array of 32 printable\ncharacters.  The character referenced by the index is placed in the\noutput string.  These characters, identified in the table below, are\nselected from US-ASCII digits and uppercase letters.\n\nWhen a bit stream is encoded via the base 32 encoding, the\nbit stream must be presumed to be ordered with the most-significant-\nbit first.  That is, the first bit in the stream will be the high-\norder bit in the first 8bit byte, the eighth bit will be the low-\norder bit in the first 8bit byte, and so on.\n\nA 33-character subset of US-ASCII is used, enabling 5 bits to be\nrepresented per printable character.  (The extra 33rd character, \"=\",\nis used to signify a special processing function.)\n\n```.txt\n                  The Base 32 Alphabet\n\n  Value Encoding  Value Encoding  Value Encoding  Value Encoding\n      0 A             9 J            18 S            27 3\n      1 B            10 K            19 T            28 4\n      2 C            11 L            20 U            29 5\n      3 D            12 M            21 V            30 6\n      4 E            13 N            22 W            31 7\n      5 F            14 O            23 X\n      6 G            15 P            24 Y         (pad) =\n      7 H            16 Q            25 Z\n      8 I            17 R            26 2\n```\n\n## Thanks for reading!\n\n[Nathan J. Hood](https://github.com/nathanjhood)\n\n## Acknowledgements:\n\n- [\"The Base16, Base32, and Base64 Data Encodings\"](https://datatracker.ietf.org/doc/html/rfc4648); S. Josefsson (Copyright (C) 2006 The Internet Society).\n\n- 'base32.cpp'; The central encode/decode algorithm is a heavily modified implementation taken from René Nyffenegger's 'base64.cpp' (Copyright (C) 2004-2008 René Nyffenegger) from the below discussion:\n\n- [https://stackoverflow.com/questions/180947/base64-decode-snippet-in-c](https://stackoverflow.com/questions/180947/base64-decode-snippet-in-c)\n\n- [A more recent (version 2) revision of that algorithm is also publically available](https://renenyffenegger.ch/notes/development/Base64/Encoding-and-decoding-base-64-with-cpp/). My reasons for adapting an earlier version is because I intend to attempt several other encode/decode algorithms using a similar approach to this implementation, which has slightly less of the functionality tailored specifically for base64, and thus shall be more adaptable into other forms.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnathanjhood%2Fbase32","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnathanjhood%2Fbase32","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnathanjhood%2Fbase32/lists"}