Updates
This commit is contained in:
+19
@@ -0,0 +1,19 @@
|
||||
export type GrabEncryptionKeysParam = {
|
||||
encryptionKey?: string;
|
||||
encryptionSalt?: string;
|
||||
apiKey?: string;
|
||||
algorithm?: string;
|
||||
bufferAllocSize?: number;
|
||||
};
|
||||
/**
|
||||
* # Grab Encryption Keys
|
||||
* @description Grab Required Encryption Keys
|
||||
*/
|
||||
export default function grabKeys(param?: GrabEncryptionKeysParam): {
|
||||
key: string | undefined;
|
||||
keyLen: number;
|
||||
salt: string | undefined;
|
||||
apiKey: string | undefined;
|
||||
algorithm: string;
|
||||
bufferAllocSize: number;
|
||||
};
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
"use strict";
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.default = grabKeys;
|
||||
const numberfy_1 = __importDefault(require("./numberfy"));
|
||||
/**
|
||||
* # Grab Encryption Keys
|
||||
* @description Grab Required Encryption Keys
|
||||
*/
|
||||
function grabKeys(param) {
|
||||
return {
|
||||
key: (param === null || param === void 0 ? void 0 : param.encryptionKey) || process.env.DSQL_ENCRYPTION_PASSWORD,
|
||||
keyLen: process.env.DSQL_ENCRYPTION_KEY_LENGTH
|
||||
? Number(process.env.DSQL_ENCRYPTION_KEY_LENGTH)
|
||||
: 24,
|
||||
salt: (param === null || param === void 0 ? void 0 : param.encryptionSalt) || process.env.DSQL_ENCRYPTION_SALT,
|
||||
apiKey: (param === null || param === void 0 ? void 0 : param.apiKey) || process.env.DSQL_API_KEY,
|
||||
algorithm: (param === null || param === void 0 ? void 0 : param.algorithm) ||
|
||||
process.env.DSQL_ENCRYPTION_ALGORITHM ||
|
||||
"aes-192-cbc",
|
||||
bufferAllocSize: (param === null || param === void 0 ? void 0 : param.bufferAllocSize) ||
|
||||
(process.env.DSQL_ENCRYPTION_BUFFER_ALLOCATION_SIZE
|
||||
? (0, numberfy_1.default)(process.env.DSQL_ENCRYPTION_BUFFER_ALLOCATION_SIZE)
|
||||
: undefined) ||
|
||||
16,
|
||||
};
|
||||
}
|
||||
+1
-1
@@ -7,4 +7,4 @@
|
||||
* numberfy("123.456", 0) // 123
|
||||
* numberfy("123.456", 3) // 123.456
|
||||
*/
|
||||
export default function numberfy(num: any, decimals: number): number;
|
||||
export default function numberfy(num: any, decimals?: number): number;
|
||||
|
||||
Reference in New Issue
Block a user