{"id":16396650,"url":"https://github.com/jeremybarbet/react-native-jsi-base-coder","last_synced_at":"2025-10-05T06:57:45.152Z","repository":{"id":40393856,"uuid":"486546494","full_name":"jeremybarbet/react-native-jsi-base-coder","owner":"jeremybarbet","description":"Base64/32/16 encoding/decoding for React Native written in C/C++ and JSI.","archived":false,"fork":false,"pushed_at":"2022-05-11T08:11:31.000Z","size":435,"stargazers_count":81,"open_issues_count":2,"forks_count":3,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-01T23:09:59.578Z","etag":null,"topics":["android","base16","base32","base64","cpp","crockford","decode","encode","ios","jsi","react-native","rfc4648"],"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/jeremybarbet.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"patreon":"helloaurora","custom":"paypal.me/helloauroraapp"}},"created_at":"2022-04-28T10:24:35.000Z","updated_at":"2025-02-11T15:51:40.000Z","dependencies_parsed_at":"2022-08-09T19:10:37.724Z","dependency_job_id":null,"html_url":"https://github.com/jeremybarbet/react-native-jsi-base-coder","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/jeremybarbet/react-native-jsi-base-coder","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeremybarbet%2Freact-native-jsi-base-coder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeremybarbet%2Freact-native-jsi-base-coder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeremybarbet%2Freact-native-jsi-base-coder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeremybarbet%2Freact-native-jsi-base-coder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jeremybarbet","download_url":"https://codeload.github.com/jeremybarbet/react-native-jsi-base-coder/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeremybarbet%2Freact-native-jsi-base-coder/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278420211,"owners_count":25983814,"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","status":"online","status_checked_at":"2025-10-05T02:00:06.059Z","response_time":54,"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":["android","base16","base32","base64","cpp","crockford","decode","encode","ios","jsi","react-native","rfc4648"],"created_at":"2024-10-11T05:08:05.296Z","updated_at":"2025-10-05T06:57:45.136Z","avatar_url":"https://github.com/jeremybarbet.png","language":"TypeScript","funding_links":["https://patreon.com/helloaurora","paypal.me/helloauroraapp"],"categories":["TypeScript"],"sub_categories":[],"readme":"# react-native-jsi-base-coder\n\nBase64/32/16 encoding/decoding for React Native written in C/C++ and JSI.\n\n## Installation\n\n### React Native\n\n```bash\nyarn add react-native-jsi-base-coder\n```\n\n### Expo\n\n```bash\nexpo install react-native-jsi-base-coder\nexpo prebuild\n```\n\n## Usage\n\nDefault behavior is using the `base64Rfc4648` algorithm to encode/decode the data.\n\n```ts\nimport { encode, decode } from 'react-native-jsi-base-coder';\n\n// With the default algorithm in `base64Rfc4648`.\nencode('Hello World!'); // SGVsbG8gV29ybGQh\ndecode('SGVsbG8gV29ybGQh'); // Hello World!\n\n// With the Base32 algorithm with the `base32Rfc4648`.\nencode('Hello World!', { algorithm: Algorithm.base32Rfc4648 }); // JBSWY3DPEBLW64TMMQQQ====\ndecode('JBSWY3DPEBLW64TMMQQQ====', { algorithm: Algorithm.base32Rfc4648 }); // Hello World!\n```\n\n## API\n\n### `encode`\n\n```ts\nfunction (stringToEncode: string, config?: Config): string\n```\n\nTakes a string and returns an encoded string.\n\n### `decode`\n\nTakes an encoded string and returns a decoded string.\n\n```ts\nfunction (bytesToDecode: string, config?: Config): string\n```\n\n### `config`\n\nThe config object only take one property `algorithm` to define how you want to encode/decode your data. The default algorithm used is `base64Rfc4648`.\n\n```ts\nenum Algorithm {\n  'base64Rfc4648' = 'base64Rfc4648',\n  'base64Url' = 'base64Url',\n  'base64UrlUnpadded' = 'base64UrlUnpadded',\n  'base32Rfc4648' = 'base32Rfc4648',\n  'base32Crockford' = 'base32Crockford',\n  'base32Hex' = 'base32Hex',\n  'base16Upper' = 'base16Upper',\n  'base16Lower' = 'base16Lower',\n}\n\nencode('string to encode', { algorithm: Algorithm.base32Crockford });\n```\n\n## Example\n\nTo run the development example you can use the following command:\n\n```bash\ncd example\nyarn\n```\n\n## Acknowledgements\n\n- Thanks to Marc for his JSI template [react-native-jsi-library-template](https://github.com/mrousavy/react-native-jsi-library-template).\n- Thanks to [cppcodec](https://github.com/tplgy/cppcodec) for the C implementation.\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjeremybarbet%2Freact-native-jsi-base-coder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjeremybarbet%2Freact-native-jsi-base-coder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjeremybarbet%2Freact-native-jsi-base-coder/lists"}