-
Notifications
You must be signed in to change notification settings - Fork 138
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add namespace to typedef and bump ver to 2.0
- Loading branch information
Showing
6 changed files
with
21 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,15 @@ | ||
declare module 'react-native-aes-crypto' { | ||
function pbkdf2(password: string, salt: string, cost: number, length: number): Promise<string> | ||
function encrypt(text: string, key: string, iv: string, algorithm: string): Promise<string> | ||
function decrypt(ciphertext: string, key: string, iv: string): Promise<string> | ||
function hmac256(ciphertext: string, key: string): Promise<string> | ||
function hmac512(ciphertext: string, key: string): Promise<string> | ||
function randomKey(length: number): Promise<string> | ||
function sha1(text: string): Promise<string> | ||
function sha256(text: string): Promise<string> | ||
function sha512(text: string): Promise<string> | ||
namespace Aes { | ||
type Algorithms = 'aes-128-cbc' | 'aes-192-cbc' | 'aes-256-cbc' | ||
|
||
function pbkdf2(password: string, salt: string, cost: number, length: number): Promise<string> | ||
function encrypt(text: string, key: string, iv: string, algorithm: Algorithms): Promise<string> | ||
function decrypt(ciphertext: string, key: string, iv: string, algorithm: Algorithms): Promise<string> | ||
function hmac256(ciphertext: string, key: string): Promise<string> | ||
function hmac512(ciphertext: string, key: string): Promise<string> | ||
function randomKey(length: number): Promise<string> | ||
function sha1(text: string): Promise<string> | ||
function sha256(text: string): Promise<string> | ||
function sha512(text: string): Promise<string> | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
'use strict'; | ||
import { NativeModules } from 'react-native'; | ||
'use strict' | ||
import { NativeModules } from 'react-native' | ||
|
||
export default NativeModules.Aes; | ||
export default NativeModules.Aes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters