@pmishra0/react-native-aes-gcm 0.1.3 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -12,16 +12,24 @@ npm install react-native-aes-gcm
12
12
 
13
13
 
14
14
  ```js
15
- import { encrypt, decrypt } from 'react-native-aes-gcm';
15
+ import { encrypt, decrypt } from '@pmishra0/react-native-aes-gcm';
16
16
 
17
17
  // ...
18
18
 
19
- const encrypted = await encrypt(text, key, iterations).catch((e) => {
19
+ const encrypted = await encrypt(text, key, {
20
+ iterationCount: 1000,
21
+ saltLength: 16,
22
+ ivLength: 12
23
+ }).catch((e) => {
20
24
  console.log('Error Enctyption:: ', e);
21
25
 
22
26
  });
23
27
 
24
- const decrypted = await decrypt(text, key, iterations).catch((e) => {
28
+ const decrypted = await decrypt(text, key, {
29
+ iterationCount: 1000,
30
+ saltLength: 16,
31
+ ivLength: 12
32
+ }).catch((e) => {
25
33
  console.log('Error:: ', e);
26
34
 
27
35
  });
@@ -1,33 +1,21 @@
1
1
  package com.aesgcm
2
2
 
3
- import com.facebook.react.BaseReactPackage
3
+ import com.facebook.react.ReactPackage
4
4
  import com.facebook.react.bridge.NativeModule
5
5
  import com.facebook.react.bridge.ReactApplicationContext
6
- import com.facebook.react.module.model.ReactModuleInfo
7
- import com.facebook.react.module.model.ReactModuleInfoProvider
8
- import java.util.HashMap
6
+ import com.facebook.react.uimanager.ViewManager
9
7
 
10
- class AesGcmPackage : BaseReactPackage() {
11
- override fun getModule(name: String, reactContext: ReactApplicationContext): NativeModule? {
12
- return if (name == AesGcmModule.NAME) {
13
- AesGcmModule(reactContext)
14
- } else {
15
- null
16
- }
8
+ class AesGcmPackage : ReactPackage {
9
+
10
+ override fun createNativeModules(
11
+ reactContext: ReactApplicationContext
12
+ ): List<NativeModule> {
13
+ return listOf(AesGcmModule(reactContext))
17
14
  }
18
15
 
19
- override fun getReactModuleInfoProvider(): ReactModuleInfoProvider {
20
- return ReactModuleInfoProvider {
21
- val moduleInfos: MutableMap<String, ReactModuleInfo> = HashMap()
22
- moduleInfos[AesGcmModule.NAME] = ReactModuleInfo(
23
- AesGcmModule.NAME,
24
- AesGcmModule.NAME,
25
- false, // canOverrideExistingModule
26
- false, // needsEagerInit
27
- false, // isCxxModule
28
- true // isTurboModule
29
- )
30
- moduleInfos
31
- }
16
+ override fun createViewManagers(
17
+ reactContext: ReactApplicationContext
18
+ ): List<ViewManager<*, *>> {
19
+ return emptyList()
32
20
  }
33
21
  }
package/package.json CHANGED
@@ -1,12 +1,17 @@
1
1
  {
2
2
  "name": "@pmishra0/react-native-aes-gcm",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "AES-GCM encryption/decryption for React Native",
5
5
  "source": "./src/index.tsx",
6
6
  "main": "./lib/module/index.js",
7
+ "module": "./lib/module/index.js",
8
+ "types": "lib/typescript/src/index.d.ts",
9
+ "react-native": "./src/index",
7
10
  "exports": {
8
11
  ".": {
9
12
  "types": "./lib/typescript/src/index.d.ts",
13
+ "import": "./lib/module/index.js",
14
+ "require": "./lib/commonjs/index.js",
10
15
  "default": "./lib/module/index.js"
11
16
  },
12
17
  "./package.json": "./package.json"