@finan-me/react-native-cipher v1.0.5
React Native Cipher
React Native Cipher is a library that provides encryption and decryption functionalities for React Native applications.
Installation
yarn add @finan-me/react-native-cipher
Additional Dependencies
To ensure React Native Cipher works properly, you should also install the following libraries:
react-native-randombytes
yarn add react-native-randombytes
node-libs-react-native
yarn add node-libs-react-native
Usage
This package exports a mapping of absolute paths to each module implementation, keyed by module name. Modules without React Native compatible implementations are null.
These modules can be used with React Native Packager's metro.config.js or Webpack's resolve.alias.
Usage with React Native Packager Add a metro.config.js file in the root directory of your React Native project and set resolver.extraNodeModules:
// metro.config.js
module.exports = {
resolver: {
extraNodeModules: require('node-libs-react-native'),
},
};
Globals
Node has certain globals that modules may expect, such as Buffer or process. React Native does not provide these globals. The node-libs-react-native/globals module in this package will shim the global environment to add these globals. Just require (or import) this module in your app before anything else.
import 'node-libs-react-native/globals';