UNPKG

axiodb

Version:

A blazing-fast, lightweight, and scalable nodejs package based DBMS for modern application. Supports schemas, encryption, and advanced query capabilities.

58 lines (57 loc) 1.97 kB
import { SuccessInterface } from "../config/Interfaces/Helper/response.helper.interface"; /** * Helper class for cryptographic operations such as encryption and decryption. */ export declare class CryptoHelper { /** * The encryption key used for cryptographic operations. */ private encryptionKey; /** * Instance of ResponseHelper to handle responses. */ private readonly responseHelper; /** * Instance of Cryptography class for performing cryptographic operations. */ private readonly Cryptography; /** * Instance of Converter class for converting data formats. */ private readonly Converter; /** * Constructor to initialize the CryptoHelper class. * @param encryptionKey - Optional encryption key. If not provided, a default key based on hostname and platform will be used. */ constructor(encryptionKey?: string); /** * Sets a new encryption key. * @param encryptionKey - The new encryption key to be set. * @returns A promise that resolves to a success response. */ setEncryptionKey(encryptionKey: string): Promise<SuccessInterface>; /** * Encrypts data asynchronously. * @param data - The data to be encrypted. * @returns A promise that resolves to the encrypted data as a string. */ encrypt(data: string): Promise<string>; /** * Decrypts data asynchronously. * @param data - The data to be decrypted. * @returns A promise that resolves to the decrypted data as an object. */ decrypt(data: string): Promise<any>; /** * Encrypts data synchronously. * @param data - The data to be encrypted. * @returns The encrypted data as a string. */ encryptSync(data: string): string; /** * Decrypts data synchronously. * @param data - The data to be decrypted. * @returns The decrypted data as an object. */ decryptSync(data: string): object; }