{"id":13720770,"url":"https://github.com/craftzdog/react-native-quick-base64","last_synced_at":"2025-04-08T09:12:39.895Z","repository":{"id":42016922,"uuid":"336173638","full_name":"craftzdog/react-native-quick-base64","owner":"craftzdog","description":"A fast base64 module for React Native","archived":false,"fork":false,"pushed_at":"2024-04-25T13:24:34.000Z","size":2632,"stargazers_count":379,"open_issues_count":10,"forks_count":25,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-01T08:38:08.637Z","etag":null,"topics":["react-native"],"latest_commit_sha":null,"homepage":"","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/craftzdog.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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-02-05T05:28:56.000Z","updated_at":"2025-03-29T03:56:48.000Z","dependencies_parsed_at":"2024-03-01T01:45:02.255Z","dependency_job_id":"d668e211-b68c-41af-9713-c2fdb4478b15","html_url":"https://github.com/craftzdog/react-native-quick-base64","commit_stats":{"total_commits":57,"total_committers":4,"mean_commits":14.25,"dds":0.07017543859649122,"last_synced_commit":"24a12cfea65abea1223d5d636144cba809f2ae87"},"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/craftzdog%2Freact-native-quick-base64","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/craftzdog%2Freact-native-quick-base64/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/craftzdog%2Freact-native-quick-base64/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/craftzdog%2Freact-native-quick-base64/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/craftzdog","download_url":"https://codeload.github.com/craftzdog/react-native-quick-base64/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247809964,"owners_count":20999816,"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":["react-native"],"created_at":"2024-08-03T01:01:07.895Z","updated_at":"2025-04-08T09:12:39.864Z","avatar_url":"https://github.com/craftzdog.png","language":"TypeScript","funding_links":[],"categories":["C++"],"sub_categories":[],"readme":"# react-native-quick-base64\n\nA native implementation of Base64 in C++ for React Native.\n\n~16x faster than [base64-js](https://github.com/beatgammit/base64-js) on an iPhone 15 Pro Max simulator.\nTry the benchmarks under [example](./example).\n\n| iPhone                                            | Android                                             |\n| ------------------------------------------------- | --------------------------------------------------- |\n| ![iPhone](./docs/iphone-15-pro-max-simulator.png) | ![Android](./docs/android-pixel-6-pro-emulator.png) |\n\n## Installation\n\n```sh\nnpm install react-native-quick-base64\n```\n\n## Usage\n\n```js\nimport { btoa, atob } from 'react-native-quick-base64'\n\nconst base64 = btoa('foo')\nconst decoded = atob(base64)\n```\n\n## Methods\n\nCompatible with [base64-js](https://github.com/beatgammit/base64-js).\n\n#### `byteLength(b64: string): number`\n\nTakes a base64 string and returns length of byte array.\n\n#### `toByteArray(b64: string, removeLinebreaks: boolean = false): Uint8Array`\n\nTakes a base64 string and returns a byte array. Optional `removeLinebreaks` removes all `\\n` characters.\n\n#### `fromByteArray(uint8: Uint8Array, urlSafe: boolean = false): string`\n\nTakes a byte array and returns a base64 string. Optional `urlSafe` flag `true` will use [the URL-safe dictionary](https://github.com/craftzdog/react-native-quick-base64/blob/9d02dfd02599ca104d2ed6c1e2d938ddd9d6cd15/cpp/base64.h#L75).\n\n#### `btoa(data: string): string`\n\nEncodes a string in base64.\n\n#### `atob(b64: string): string`\n\nDecodes a base64 encoded string.\n\n#### `shim()`\n\nAdds `btoa` and `atob` functions to `global`.\n\n#### `trimBase64Padding = (str: string): string`\n\nTrims the `=` padding character(s) off of the end of a base64 encoded string. Also, for base64url encoded strings, it will trim off the trailing `.` character(s).\n\n## Contributing\n\nSee the [contributing guide](CONTRIBUTING.md) to learn how to contribute to the repository and the development workflow.\n\n## License\n\nMIT by Takuya Matsuyama\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcraftzdog%2Freact-native-quick-base64","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcraftzdog%2Freact-native-quick-base64","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcraftzdog%2Freact-native-quick-base64/lists"}