Skip to content

Commit 1a84c5d

Browse files
committed
type dec updated
COMPILED
1 parent 76ab308 commit 1a84c5d

File tree

8 files changed

+19
-39
lines changed

8 files changed

+19
-39
lines changed

Diff for: lib/BufferEncryptorV8/cryptBigBuffer.d.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
import type { EncryptBigBuffer, DecryptBigBuffer } from "./cryptBigBuffer.types";
1+
/// <reference types="node" />
22
/**
3-
* ### BigBuffer encrypter with v8 serializer
3+
* @description BigBuffer encrypter with v8 serializer
44
* @param publicKey Public Key as string
55
* @param modLength Maximum length of each chunk encrypted individually
66
* @param data Data to encrypt
77
* @returns Encrypted data
88
*/
9-
export declare const encryptBigBuffer: EncryptBigBuffer;
9+
export declare const encryptBigBuffer: (publicKey: string, modLength: number, data: Buffer) => Buffer;
1010
/**
11-
* ### BigBuffer encrypter for v8 serializer data
11+
* @description BigBuffer encrypter for v8 serializer data
1212
* @param privateKey Private Key as string
1313
* @param data Encrypted data to decrypt
1414
* @returns Decrypted data
1515
*/
16-
export declare const decryptBigBuffer: DecryptBigBuffer;
16+
export declare const decryptBigBuffer: (privateKey: string, data: Buffer) => Buffer;

Diff for: lib/BufferEncryptorV8/cryptBigBuffer.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ exports.decryptBigBuffer = exports.encryptBigBuffer = void 0;
44
const v8_1 = require("v8");
55
const cryptRow_1 = require("./cryptRow");
66
/**
7-
* ### BigBuffer encrypter with v8 serializer
7+
* @description BigBuffer encrypter with v8 serializer
88
* @param publicKey Public Key as string
99
* @param modLength Maximum length of each chunk encrypted individually
1010
* @param data Data to encrypt
@@ -19,7 +19,7 @@ const encryptBigBuffer = (publicKey, modLength, data) => {
1919
};
2020
exports.encryptBigBuffer = encryptBigBuffer;
2121
/**
22-
* ### BigBuffer encrypter for v8 serializer data
22+
* @description BigBuffer encrypter for v8 serializer data
2323
* @param privateKey Private Key as string
2424
* @param data Encrypted data to decrypt
2525
* @returns Decrypted data

Diff for: lib/BufferEncryptorV8/cryptRow.d.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import type { EncryptRows, DecryptRows } from "./cryptRow.types";
1+
/// <reference types="node" />
22
/**
33
* @returns Array of Buffers encrypted with provided public Key
44
*/
5-
export declare const encryptRows: EncryptRows;
5+
export declare const encryptRows: (publicKey: string, bufferList: Buffer[]) => Buffer[];
66
/**
77
* @returns Array of Buffers decrypted with provided private Key
88
*/
9-
export declare const decryptRows: DecryptRows;
9+
export declare const decryptRows: (privateKey: string, bufferList: Buffer[]) => Buffer[];

Diff for: lib/BufferEncryptorV8/index.d.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/// <reference types="node" />
12
import { encryptBigBuffer, decryptBigBuffer } from "./cryptBigBuffer";
23
/**
34
* ### V8 serialiser (Recommended)
@@ -6,7 +7,7 @@ import { encryptBigBuffer, decryptBigBuffer } from "./cryptBigBuffer";
67
* - Space efficient
78
*/
89
declare const v8: {
9-
encryptBigBuffer: import("./cryptBigBuffer.types").EncryptBigBuffer;
10-
decryptBigBuffer: import("./cryptBigBuffer.types").DecryptBigBuffer;
10+
encryptBigBuffer: (publicKey: string, modLength: number, data: Buffer) => Buffer;
11+
decryptBigBuffer: (privateKey: string, data: Buffer) => Buffer;
1112
};
1213
export { v8, encryptBigBuffer, decryptBigBuffer };

Diff for: src/BufferEncryptorV8/cryptBigBuffer.ts

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
import { deserialize, serialize } from "v8";
2-
import type { EncryptBigBuffer, DecryptBigBuffer } from "./cryptBigBuffer.types";
32
import { decryptRows, encryptRows } from "./cryptRow";
43

54
/**
6-
* ### BigBuffer encrypter with v8 serializer
5+
* @description BigBuffer encrypter with v8 serializer
76
* @param publicKey Public Key as string
87
* @param modLength Maximum length of each chunk encrypted individually
98
* @param data Data to encrypt
109
* @returns Encrypted data
1110
*/
12-
export const encryptBigBuffer: EncryptBigBuffer = (publicKey: string, modLength: number, data: Buffer) => {
11+
export const encryptBigBuffer = (publicKey: string, modLength: number, data: Buffer) => {
1312
var bufferList: Buffer[] = []
1413
for (var i = 0; i < data.length; i += modLength)
1514
bufferList.push(
@@ -20,12 +19,12 @@ export const encryptBigBuffer: EncryptBigBuffer = (publicKey: string, modLength:
2019
}
2120

2221
/**
23-
* ### BigBuffer encrypter for v8 serializer data
22+
* @description BigBuffer encrypter for v8 serializer data
2423
* @param privateKey Private Key as string
2524
* @param data Encrypted data to decrypt
2625
* @returns Decrypted data
2726
*/
28-
export const decryptBigBuffer: DecryptBigBuffer = (privateKey: string, data: Buffer) => {
27+
export const decryptBigBuffer = (privateKey: string, data: Buffer) => {
2928
const encryptedBufferList: Buffer[] = deserialize(data)
3029
const bufferList = decryptRows(privateKey, encryptedBufferList)
3130
return Buffer.concat(bufferList)

Diff for: src/BufferEncryptorV8/cryptBigBuffer.types.ts

-16
This file was deleted.

Diff for: src/BufferEncryptorV8/cryptRow.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
import { privateDecrypt, publicEncrypt } from "crypto";
2-
import type { EncryptRows, DecryptRows } from "./cryptRow.types";
32

43
/**
54
* @returns Array of Buffers encrypted with provided public Key
65
*/
7-
export const encryptRows: EncryptRows = (publicKey: string, bufferList: Buffer[]) => (
6+
export const encryptRows = (publicKey: string, bufferList: Buffer[]) => (
87
bufferList.map(data => (
98
publicEncrypt( publicKey, data)
109
))
@@ -13,7 +12,7 @@ export const encryptRows: EncryptRows = (publicKey: string, bufferList: Buffer[]
1312
/**
1413
* @returns Array of Buffers decrypted with provided private Key
1514
*/
16-
export const decryptRows: DecryptRows = (privateKey: string, bufferList: Buffer[]) => (
15+
export const decryptRows = (privateKey: string, bufferList: Buffer[]) => (
1716
bufferList.map(data => (
1817
privateDecrypt(privateKey, data)
1918
))

Diff for: src/BufferEncryptorV8/cryptRow.types.ts

-3
This file was deleted.

0 commit comments

Comments
 (0)