|
1 | 1 | declare module 'react-native-aes-crypto' { |
2 | | - function pbkdf2(password: string, salt: string, cost: number, length: number): Promise<string> |
3 | | - function encrypt(text: string, key: string, iv: string, algorithm: string): Promise<string> |
4 | | - function decrypt(ciphertext: string, key: string, iv: string): Promise<string> |
5 | | - function hmac256(ciphertext: string, key: string): Promise<string> |
6 | | - function hmac512(ciphertext: string, key: string): Promise<string> |
7 | | - function randomKey(length: number): Promise<string> |
8 | | - function sha1(text: string): Promise<string> |
9 | | - function sha256(text: string): Promise<string> |
10 | | - function sha512(text: string): Promise<string> |
| 2 | + namespace Aes { |
| 3 | + type Algorithms = 'aes-128-cbc' | 'aes-192-cbc' | 'aes-256-cbc' |
| 4 | + |
| 5 | + function pbkdf2(password: string, salt: string, cost: number, length: number): Promise<string> |
| 6 | + function encrypt(text: string, key: string, iv: string, algorithm: Algorithms): Promise<string> |
| 7 | + function decrypt(ciphertext: string, key: string, iv: string, algorithm: Algorithms): Promise<string> |
| 8 | + function hmac256(ciphertext: string, key: string): Promise<string> |
| 9 | + function hmac512(ciphertext: string, key: string): Promise<string> |
| 10 | + function randomKey(length: number): Promise<string> |
| 11 | + function sha1(text: string): Promise<string> |
| 12 | + function sha256(text: string): Promise<string> |
| 13 | + function sha512(text: string): Promise<string> |
| 14 | + } |
11 | 15 | } |
0 commit comments