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 or CRDT-based local first databases to speed up common cryptography functions.
🏎️ Hundreds of times faster than all JS-based solutions
⚡️ Lightning fast implementation with Nitro Modules (pure C++ and JSI) instead of JS
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.
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
React Native
bun add react-native-quick-crypto react-native-nitro-modules react-native-quick-base64
cd ios && pod install
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-cryptoreturn 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:
Note:react-native-quick-crypto re-exports Buffer from @craftzdog/react-native-buffer, so you can use either as the buffer alias. Using react-native-quick-crypto ensures a single Buffer instance across your app.
Then restart your bundler using yarn start --reset-cache.
Usage
For example, to hash a string with SHA256 you can do the following:
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.
react-native-quick-crypto was built at Margelo, an elite app development agency. For enterprise support or other business inquiries, contact us at hello@margelo.com!
Contributing
See the contributing guide to learn how to contribute to the repository and the development workflow.
For more detailed guides, check out our documentation website:
A fast implementation of Node's `crypto` module written in C/C++ JSI
The npm package react-native-quick-crypto receives a total of 85,071 weekly downloads. As such, react-native-quick-crypto popularity was classified as popular.
We found that react-native-quick-crypto demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago.It has 3 open source maintainers collaborating on the project.
Package last updated on 03 Mar 2026
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
The GCVE initiative operated by CIRCL has officially opened its publishing ecosystem, letting organizations issue and share vulnerability identifiers without routing through a central authority.