Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-native-quick-crypto

Package Overview
Dependencies
Maintainers
1
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-quick-crypto

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

  • 0.3.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
22K
decreased by-48.95%
Maintainers
1
Weekly downloads
 
Created
Source

⚡️ react-native-quick-crypto

A fast implementation of Node's crypto module.

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 300x 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
  • 🤌 Up to 5x smaller in JS-bundle size
  • 🔢 Secure native compiled cryptography
  • 🔁 Easy drop-in replacement for crypto-browserify or react-native-crypto

For example, creating a Wallet using ethers.js uses complex algorithms to generate a private-key/mnemonic-phrase pair:

const start = performance.now()
const wallet = ethers.Wallet.createRandom()
const end = performance.now()
console.log(`Creating a Wallet took ${end - start}ms.`)

Without react-native-crypto 🐢:

Creating a Wallet took xxxms

With react-native-crypto ⚡️:

Creating a Wallet took yyyms

Installation

React Native  

yarn add react-native-quick-crypto
cd ios && pod install

Expo  

expo install react-native-quick-crypto
expo prebuild

Usage

In your babel.config.js, add a module resolver to replace crypto with react-native-quick-crypto:

+const path = require('path');

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

Now, all imports for crypto will be resolved as react-native-quick-crypto instead.


Sponsors

  • TODO: List sponsors here

Limitations

As the library uses JSI for synchronous native methods access, remote debugging (e.g. with Chrome) is no longer possible. Instead, you should use Flipper.

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 hello@margelo.io!

Contributing

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

License

MIT

Keywords

FAQs

Package last updated on 25 Jul 2022

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc