UNPKG

tiny-essentials

Version:

Collection of small, essential scripts designed to be used across various projects. These simple utilities are crafted for speed, ease of use, and versatility.

21 lines 976 B
/** * Encrypts a string using one or more keys from the provided crypto configuration. * * If `tinyCrypto.key` is an array, the encryption is applied sequentially (layered encryption). * * @param {Object} tinyCrypto - The crypto configuration object. * @param {string|string[]} tinyCrypto.key - A single encryption key or an array of keys to apply in sequence. * @param {number} tinyCrypto.IV_LENGTH - The byte length of the initialization vector. * @param {string} tinyCrypto.algorithm - The encryption algorithm to use. * @param {BufferEncoding} tinyCrypto.stringType - The encoding type used for output (e.g., 'hex', 'base64'). * @param {string} text - The plain text string to encrypt. * @returns {string} The final encrypted string. * @deprecated */ export function encrypt(tinyCrypto: { key: string | string[]; IV_LENGTH: number; algorithm: string; stringType: BufferEncoding; }, text: string): string; //# sourceMappingURL=encrypt.d.mts.map