{"id":15646430,"url":"https://github.com/martinheidegger/base64-codec","last_synced_at":"2025-03-29T23:17:07.554Z","repository":{"id":57700046,"uuid":"498024719","full_name":"martinheidegger/base64-codec","owner":"martinheidegger","description":"base64 to/from bytes codec (esm/cjs)","archived":false,"fork":false,"pushed_at":"2022-05-30T16:51:47.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-18T16:58:41.904Z","etag":null,"topics":["b64","base64","esm","javascript"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/martinheidegger.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":"2022-05-30T16:46:09.000Z","updated_at":"2022-05-30T16:58:40.000Z","dependencies_parsed_at":"2022-09-26T21:10:40.006Z","dependency_job_id":null,"html_url":"https://github.com/martinheidegger/base64-codec","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/martinheidegger%2Fbase64-codec","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/martinheidegger%2Fbase64-codec/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/martinheidegger%2Fbase64-codec/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/martinheidegger%2Fbase64-codec/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/martinheidegger","download_url":"https://codeload.github.com/martinheidegger/base64-codec/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246254149,"owners_count":20747949,"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":["b64","base64","esm","javascript"],"created_at":"2024-10-03T12:12:51.377Z","updated_at":"2025-03-29T23:17:07.535Z","avatar_url":"https://github.com/martinheidegger.png","language":"JavaScript","readme":"# @leichtgewicht/base64-codec\n\nA javascript-only (esm/cjs) base64 codec that is [abstract-encoding][] compatible,\nwell-tested and pretty efficient. Bonus: It doesn't use Nodejs' Buffer object\nand comes with typescript types.\n\n[abstract-encoding]: https://github.com/mafintosh/abstract-encoding\n\n## Usage\n\n```js\nimport { base64 } from '@leichtgewicht/base64-codec' // require works too!\n\nconst str = 'AA=='\nconst bytes = base64.encode(\n  str,\n  new Uint8Array(base64.encodingLength(str)), // own buffer supplied, optional\n  0 // offset, at which to write the str, optional\n)\nstr === base64.decode(bytes, 0, bytes.length)\n```\n\n## URL Support\n\nUse `base64URL` for de-/encoding for the URL variant of base64.\n\n```js\nimport { base64URL } from '@leichtgewicht/base64-codec'\n```\n\n## Concatenated Buffer\n\nFor performance reasons, this codec **does not** support [concatenated\nbase64 strings](https://en.wikipedia.org/wiki/Base64#Output_padding).\n\nIf you need to encode concatenated strings, split them before passing them to this codec.\n\n## Why?\n\nThere are plenty of base64 implementations on NPM, but when looking into\nthem there was none with cjs/esm support that offered positional encoding\nand bringing one owns buffer.\n\n## License\n\n[MIT](./LICENSE)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmartinheidegger%2Fbase64-codec","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmartinheidegger%2Fbase64-codec","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmartinheidegger%2Fbase64-codec/lists"}