Home

Awesome

React Native Des (remobile)

A des crypto for react-native

Installation

npm install @remobile/react-native-des --save

Installation (iOS)

Installation (Android)

...
include ':react-native-des'
project(':react-native-des').projectDir = new File(rootProject.projectDir, '../node_modules/@remobile/react-native-des/android/RCTDes')
...
dependencies {
    ...
    compile project(':react-native-des')
}
......
import com.remobile.des.RCTDesPackage;  // <--- import

......

@Override
protected List<ReactPackage> getPackages() {
   ......
   new RCTDesPackage(),            // <------ add here
   ......
}


## Usage

### Example
```js
var Des = require('@remobile/react-native-des');

Des.encrypt("fangyunjiang is a good developer", "ABCDEFGH", function(base64) {
    console.log(base64); //wWcr2BJdyldTHn4z3AxA0qBIdHQkIKmpqhTgNuRd3fAFXzvIO5347g==
    Des.decrypt(base64, "ABCDEFGH", function(text) {
        console.log(text); //fangyunjiang is a good developer
    }, function(){
        console.log("error");
    });
}, function() {
    console.log("error");
});

method

Server Side