-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.d.ts
25 lines (21 loc) · 952 Bytes
/
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
declare module "@outofsync/aescrypt-helper"
import { Cipher, Decipher } from 'crypto';
type BufferOrString = Buffer | string;
declare class AESCrypt {
private algo: string;
private secret: string;
private iv: string;
test(data: BufferOrString): boolean;
testiv(data: BufferOrString): boolean;
getChunks(data: BufferOrString, len: number): Buffer[];
getCipher(secret: string, iv: string): Cipher;
getDecipher(secret: string, iv: string): Decipher;
enc(dataBuffer: Buffer, secret: string, iv: string): Buffer;
dec(dataBuffer: Buffer, secret: string, iv: string): Buffer;
encData(dataBuffer: Buffer, secret: string, iv: string): Buffer;
decData(dataBuffer: Buffer, secret: string, iv: string): Buffer;
encrypt(data: Buffer, secret: string): Buffer;
encryptiv(data: Buffer, secret: string, iv: string): Buffer;
decrypt(data: Buffer, secret: string): Buffer;
decryptiv(data: Buffer, secret: string, iv: string): Buffer;
}