1.0.2 • Published 4 months ago

react-native-zebra-aes-crypto v1.0.2

Weekly downloads
-
License
MIT
Repository
-
Last release
4 months ago

React Native Zebra AES

AES encryption/decryption for react-native

Installation

npm install --save react-native-zebra-aes-crypto

or

yarn add react-native-zebra-aes-crypto

Installation (iOS)

Using CocoaPods (React Native 0.60 and higher)
cd ios
pod install
Using React Native Link (React Native 0.59 and lower)

Run react-native link react-native-zebra-aes-crypto after which you should be able to use this library on iOS.

Installation (Android)

React Native 0.60 and higher
  • Linking is done automatically
Using React Native Link (React Native 0.59 and lower)
  • In android/settings.gradle
...
include ':react-native-zebra-aes-crypto'
project(':react-native-zebra-aes-crypto').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-zebra-aes-crypto/android')
  • In android/app/build.gradle
...
dependencies {
    ...
    compile project(':react-native-zebra-aes-crypto')
}
  • register module (in MainApplication.java)
......
import com.zebraelectronics.rnp.aes.RCTAesPackage;

......

@Override
protected List<ReactPackage> getPackages() {
   ......
   new RCTAesPackage(),
   // or
   // packages.add(new RCTAesPackage());
   ......
}

Usage

methods

  • encrypt(dataBase64, keyBase64) => base64
  • decrypt(dataBase64, keyBase64) => base64