npm.io
4.1.0 • Published yesterday

@keeex/crypto-provider-reactnative

Licence
SEE LICENSE IN LICENSE
Version
4.1.0
Deps
2
Size
50 kB
Vulns
0
Weekly
0

React-Native implementation for the @keeex/crypto package

If you're developing for a react-native Android/iOS environment; import this package alongside with @keeex/crypto.

This library uses react-native-crypto-quick to leverage a native OpenSSL implementation for most cryptographic operations.

Async operations

In previous versions, only one variant of this provider was available. Newer versions exposes three variants:

  • The mixed variant (the default export when using import "@keeex/crypto-provider-reactnative";:
    • Some features are really asynchronous and will allow interlacing (key derivation, random)
    • Some features are not really asynchronous, and might not yield everytime (key import, cipher, digest, hmac)
  • The async variant (available with import "@keeex/crypto-provider-reactnative/async.js";), which enforces yielding in all calls. This is useful if you run all operations on the main JavaScript thread, and requires some yielding for rendering, for example. It comes with a small performance cost.
  • The fully sync variant (available with import "@keeex/crypto-provider-reactnative/sync.js";), which is fully synchronous for crypto calls This enforce using synchronous calls to the underlying library. It might provides improved performances, but unless your code is really busy it should not be a big improvement. Note that some interlacing might still occurs because of the internals of the @keeex/crypto library, but it is not guaranteed.

Unless you explicitly wants cryptographic operations to always yield, it is recommended to use the mixed version (the default).

Dependencies

You must install these libraries so they are handled by React Native autolink:

  • react-native-quick-crypto
  • react-native-nitro-modules
  • react-native-quick-base64