All Projects → craftzdog → react-native-quick-base64

craftzdog / react-native-quick-base64

Licence: MIT license
A fast base64 module for React Native

Programming Languages

C++
36643 projects - #6 most used programming language
java
68154 projects - #9 most used programming language
typescript
32286 projects
objective c
16641 projects - #2 most used programming language
ruby
36898 projects - #4 most used programming language
javascript
184084 projects - #8 most used programming language

react-native-quick-base64

A native implementation of Base64 in C++ for React Native. 4x faster than base64-js on an iPhone 11 Pro. Try the benchmarks under example.

Installation

npm install react-native-quick-base64

Usage

import { btoa, atob } from 'react-native-quick-base64';

const base64 = btoa('foo');
const decoded = atob(base64);

Methods

Compatible with base64-js.

byteLength(b64: string): number

Takes a base64 string and returns length of byte array

toByteArray(b64: string): Uint8Array

Takes a base64 string and returns a byte array

fromByteArray(uint8: Uint8Array): string

Takes a byte array and returns a base64 string

btoa(data: string): string

Encodes a string in base64

atob(b64: string): string

Decodes a base64 encoded string

shim()

Adds btoa and atob functions to global.

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT by Takuya Matsuyama

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].