npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

react-native-nitro-base64

v1.1.2

Published

The fastest Base64 library for React Native, powered by simdutf SIMD C++ and Nitro Modules

Readme

react-native-nitro-base64 ⚡

The fastest Base64 library for React Native — powered by simdutf SIMD C++ and Nitro Modules.

Processes a 1.3MB image 26x faster than atob/btoa and 1.8x faster than react-native-quick-base64.

| iPhone | Android | | --- | --- | | iPhone | Android |


🤔 Why this library?

Most React Native base64 libraries hit the same bottlenecks:

  • 🐢 Pure JS (base64-js) — slow. No native acceleration.
  • ⚠️ atob/btoa — fast for tiny strings, falls apart on binary data at scale.
  • ⚠️ String-based native — crosses the JSI bridge as UTF-16, doubling memory for binary payloads.

react-native-nitro-base64 uses SIMD instructions (AVX-512 on x86, NEON on Apple Silicon) to process 64 bytes per CPU instruction, and exposes ArrayBuffer/Uint8Array APIs that bypass string marshaling entirely.

📊 Benchmark — 30 iterations, iPhone (Apple Silicon)

Tested against [email protected]

Small image (7KB)

| Library | Time | vs. nitro-base64 | |---|---|---| | ⚡ nitro-base64 decodeBuffer / fromByteArray | 0.06ms | — | | react-native-quick-base64 | 0.11ms | 1.8x slower | | atob / btoa (Hermes) | 1.04ms | 17x slower |

Large image (1.3MB)

| Library | Time | vs. nitro-base64 | |---|---|---| | ⚡ nitro-base64 decodeBuffer / fromByteArray | 7.5ms | — | | react-native-quick-base64 | 13.6ms | 1.8x slower | | atob / btoa (Hermes) | 203ms | 26x slower |


📦 Installation

yarn add react-native-nitro-base64
yarn add react-native-nitro-modules

Then follow Nitro's setup guide for autolinking.

🔧 Setup

Call install() once before your app mounts:

// index.js
import { install } from 'react-native-nitro-base64';
import { AppRegistry } from 'react-native';
import App from './src/App';
import { name as appName } from './app.json';

install();
AppRegistry.registerComponent(appName, () => App);

📖 API

| Function | Input → Output | Notes | |---|---|---| | encode(str, urlSafe?) | string → base64 string | URL-safe optional | | decode(base64) | base64 string → string | Auto-detects standard & URL-safe | | encodeBuffer(ArrayBuffer, urlSafe?) | ArrayBuffer → base64 string | 🚀 Zero-copy, fastest for images | | decodeBuffer(base64) | base64 string → ArrayBuffer | 🚀 Zero-copy, fastest for images | | fromByteArray(Uint8Array, urlSafe?) | Uint8Array → base64 string | Drop-in for react-native-quick-base64 | | toByteArray(base64) | base64 string → Uint8Array | Drop-in for react-native-quick-base64 |


🚀 Usage

🖼️ Images & files — encodeBuffer / decodeBuffer

Images are binary data. Sending binary through a JS string crosses the JSI bridge as UTF-16, doubling memory. ArrayBuffer skips that entirely — raw bytes go straight to C++.

import { encodeBuffer, decodeBuffer } from 'react-native-nitro-base64';

// Upload image to API
const response = await fetch(imageUri);
const buffer = await response.arrayBuffer();
const base64 = encodeBuffer(buffer); // → "iVBORw0KGgo..."

// Decode API response for <Image> component
const buffer = decodeBuffer(base64String); // → ArrayBuffer

🔑 Text & JWT — encode / decode

import { encode, decode } from 'react-native-nitro-base64';

const encoded = encode('Hello World!');  // "SGVsbG8gV29ybGQh"
const decoded = decode(encoded);         // "Hello World!"

// URL-safe for JWT / URL params
const token = encode(payload, true);

🔐 Web Crypto & hashing — fromByteArray / toByteArray

Drop-in replacement for react-native-quick-base64. Same API, faster engine.

import { fromByteArray, toByteArray } from 'react-native-nitro-base64';

// SHA-256 hash → base64
const hash = new Uint8Array(await crypto.subtle.digest('SHA-256', data));
const encoded = fromByteArray(hash);

// base64 → text
const bytes = toByteArray(base64String);
const text = new TextDecoder().decode(bytes);

📱 Platform Support

| Platform | Engine | |---|---| | iOS | C++ (simdutf, NEON SIMD) | | Android | C++ (simdutf, NEON / AVX2 SIMD) |


📄 License

MIT

🙏 Credits