{"id":15598630,"url":"https://github.com/fluffynuts/node-base64-test","last_synced_at":"2025-07-27T12:41:55.396Z","repository":{"id":66060518,"uuid":"190368487","full_name":"fluffynuts/node-base64-test","owner":"fluffynuts","description":"A small discovery script which ended up being a \"fun\" attempt at character-set-based brute-forcing.","archived":false,"fork":false,"pushed_at":"2019-06-05T09:43:56.000Z","size":3,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-06T16:50:43.536Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fluffynuts.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2019-06-05T09:43:15.000Z","updated_at":"2019-06-05T09:43:58.000Z","dependencies_parsed_at":"2023-04-08T19:47:25.273Z","dependency_job_id":null,"html_url":"https://github.com/fluffynuts/node-base64-test","commit_stats":{"total_commits":1,"total_committers":1,"mean_commits":1.0,"dds":0.0,"last_synced_commit":"5ce0c35fe8ce785c662862737a4b51851146fbc3"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fluffynuts%2Fnode-base64-test","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fluffynuts%2Fnode-base64-test/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fluffynuts%2Fnode-base64-test/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fluffynuts%2Fnode-base64-test/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fluffynuts","download_url":"https://codeload.github.com/fluffynuts/node-base64-test/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240466792,"owners_count":19805862,"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-03T01:40:52.278Z","updated_at":"2025-02-24T11:17:10.684Z","avatar_url":"https://github.com/fluffynuts.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"### node-base64-test\n\nThis is just a small script to demonstrate that a base64-encoded string from Node's Buffer\n_can_ contain the `+` character. Seems like an obvious thing to say, considering\n[the base64 character table](https://en.wikipedia.org/wiki/Base64#Base64_table), however\nI overheard someone saying \"I've never seen a + in a base64 string\" and thought:\n1. Perhaps Node uses one of the encodings from the above table which omits the `+`, like the url-safe one\n2. Perhaps it's just not a character which is hit very often\n\nSo I wrote this little script, which, as a whole, isn't that interesting, but it _was_\nfun coming up with a brute-forcing strategy:\n- establish a character set\n- start with the first character in that set\n- \"increment\" that character until out of characters\n    - when out of characters, reset back to the first from the set\n    - append a new character (the first from the set) and increment that, as above\n    - propagate increments up the string\n\nThe above was interesting to me because it made me think about how numbers from any\nbase would be incremented, visually. It's easy to take for granted the output from the\nfollowing (found in [count.js](count.js)):\n\n```javascript\n(async function() {\n    async function sleep(ms) {\n        return new Promise(resolve =\u003e {\n            setTimeout(resolve, ms);\n        });\n    }\n    const blank = \"       \";\n    for (let i = 1000; i \u003c 10000; i++) {\n        process.stdout.write(`\\r${blank}\\r${i}`);\n        await sleep(50);\n    }\n})();\n```\n\nWe see a pretty incrementing counter (the `sleep` calls are put in there so it's not over\nbefore you've had a chance to see what's going on and I keep it in the 1000-9999 range to\nmake the output flow seem prettier) -- and I needed a similar counter which,\ninstead of running over the character set `0123456789`, could run over an arbitrary\ncharacter set.\n\nOf course, this is by no means the only solution. If what we were looking for were an\nalternative base system for numbers, this is a pretty crap implementation. For starters,\none can't read out the value. It would probably (_definitely_) be better to have something\nwhich is base-aware and has an internal numeric value. Perhaps I'll do that some time (:\nFor now, as a brute-forcing strategy with a given character set, this will do.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffluffynuts%2Fnode-base64-test","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffluffynuts%2Fnode-base64-test","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffluffynuts%2Fnode-base64-test/lists"}