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 🙏

© 2025 – Pkg Stats / Ryan Hefner

react-native-quick-crypto

v1.0.2

Published

A fast implementation of Node's `crypto` module written in C/C++ JSI

Readme

⚡️ react-native-quick-crypto

A fast implementation of Node's crypto module.

Note: This version 1.x completed a major refactor, porting to OpenSSL 3.3+, New Architecture, Bridgeless, and Nitro Modules. It should be at or above feature-parity compared to the 0.x version. Status, as always, will be represented in implementation-coverage.md.

Note: Minimum supported version of React Native is 0.75. If you need to use earlier versions, please use 0.x versions of this library.

Features

Unlike any other current JS-based polyfills, react-native-quick-crypto is written in C/C++ JSI and provides much greater performance - especially on mobile devices. QuickCrypto can be used as a drop-in replacement for your Web3/Crypto apps to speed up common cryptography functions.

  • 🏎️ Up to 58x faster than all other solutions
  • ⚡️ Lightning fast implementation with pure C++ and JSI, instead of JS
  • 🧪 Well tested in JS and C++ (OpenSSL)
  • 💰 Made for crypto apps and Wallets
  • 🔢 Secure native compiled cryptography
  • 🔁 Easy drop-in replacement for crypto-browserify or react-native-crypto

Versions

| Version | RN Architecture | Modules | | ------- | ------ | ------- | | 1.x | new -> | Nitro Modules -> | | 0.x | old, new 🤞 | Bridge & JSI |

Migration

Our goal in refactoring to v1.0 was to maintain API compatibility. If you are upgrading to v1.0 from v0.x, and find any discrepancies, please open an issue in this repo.

Benchmarks

There is a benchmark suite in the Example app in this repo that has benchmarks of algorithms against their pure JS counterparts. This is not meant to disparage the other libraries. On the contrary, they perform amazingly well when used in a server-side Node environment. This library exists because React Native does not have that environment nor the Node Crypto API implementation at hand. So the benchmark suite is there to show you the speedup vs. the alternative of using a pure JS library on React Native.


Installation

bun add react-native-quick-crypto react-native-nitro-modules
cd ios && pod install
expo install react-native-quick-crypto
expo prebuild

Optional: override global.Buffer and global.crypto in your application as early as possible for example in index.js.

import { install } from 'react-native-quick-crypto';

install();

Replace crypto-browserify

If you are using a library that depends on crypto, instead of polyfilling it with crypto-browserify (or react-native-crypto) you can use react-native-quick-crypto for a fully native implementation. This way you can get much faster crypto operations with just a single-line change!

Using metro config

Use the resolveRequest configuration option in your metro.config.js

config.resolver.resolveRequest = (context, moduleName, platform) => {
  if (moduleName === 'crypto') {
    // when importing crypto, resolve to react-native-quick-crypto
    return context.resolveRequest(
      context,
      'react-native-quick-crypto',
      platform,
    )
  }
  // otherwise chain to the standard Metro resolver.
  return context.resolveRequest(context, moduleName, platform)
}

Using babel-plugin-module-resolver

You need to install babel-plugin-module-resolver, it's a babel plugin that will alias any imports in the code with the values you pass to it. It tricks any module that will try to import certain dependencies with the native versions we require for React Native.

yarn add --dev babel-plugin-module-resolver

Then, in your babel.config.js, add the plugin to swap the crypto, stream and buffer dependencies:

module.exports = {
  presets: ['module:metro-react-native-babel-preset'],
  plugins: [
+   [
+     'module-resolver',
+     {
+       alias: {
+         'crypto': 'react-native-quick-crypto',
+         'stream': 'readable-stream',
+         'buffer': '@craftzdog/react-native-buffer',
+       },
+     },
+   ],
    ...
  ],
};

Then restart your bundler using yarn start --reset-cache.

Usage

For example, to hash a string with SHA256 you can do the following:

import QuickCrypto from 'react-native-quick-crypto';

const hashed = QuickCrypto.createHash('sha256')
  .update('Damn, Margelo writes hella good software!')
  .digest('hex');

Limitations

Not all cryptographic algorithms are supported yet. See the implementation coverage document for more details. If you need a specific algorithm, please open a feature request issue and we'll see what we can do.

Community Discord

Join the Margelo Community Discord to chat about react-native-quick-crypto or other Margelo libraries.

Adopting at scale

react-native-quick-crypto was built at Margelo, an elite app development agency. For enterprise support or other business inquiries, contact us at [email protected]!

Contributing

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

License

  • react-native-quick-crypto is licensed under MIT.
  • react-native-quick-crypto is heavily inspired by NodeJS Crypto, which is licensed under nodejs/LICENSE.