-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.d.ts
41 lines (41 loc) · 1.18 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
declare module 'react-native-tcp' {
import * as net from 'net'
export = net
}
declare module 'react-native-crypto' {
import * as crypto from 'crypto'
export = crypto
}
declare module 'react-native-randombytes' {
export function randomBytes(
size: number,
callback: (err: Error | null, buf: Buffer) => void
): void
}
declare module 'react-native-aes-crypto' {
export type Algorithms = 'aes-128-cbc' | 'aes-192-cbc' | 'aes-256-cbc'
export function pbkdf2(
password: string,
salt: string,
cost: number,
length: number
): Promise<string>
export function encrypt(
text: string,
key: string,
iv: string,
algorithm: Algorithms
): Promise<string>
export function decrypt(
ciphertext: string,
key: string,
iv: string,
algorithm: Algorithms
): Promise<string>
export function hmac256(ciphertext: string, key: string): Promise<string>
export function hmac512(ciphertext: string, key: string): Promise<string>
export function randomKey(length: number): Promise<string>
export function sha1(text: string): Promise<string>
export function sha256(text: string): Promise<string>
export function sha512(text: string): Promise<string>
}