UNPKG

dikacryptjs

Version:

Encrypt and Decrypt System in Node JS

50 lines (47 loc) 1.49 kB
/** * Encrypt and Decrypt System in Node JS */ declare module "dikacryptjs" { /** * Encrypt and Decrypt Class System */ export class CryptJS { /** * @param options The encrypt options */ constructor(options: Crypt.Options) /** * Generate a salt for encrypt and decrypt * @returns Salt String */ public genSaltSync(): string /** * Encrypt a string * * @param text String to encrypt - Require * @param salt Password for the encrypt - Require * @param outputHash The type of hash you want to return - Require * * @returns Hash String */ public encrypt(text: string, salt: string, outputHash: Crypt.outputHash): string /** * Decrypt a hash string * * @param hash Hash string to decrypt - Require * @param salt Password for the decrypt - Require * @param inputHash The type of hash you entered - Require * * @returns UTF-8 String */ public decrypt(hash: string, salt: string, inputHash: Crypt.inputHash): string } declare namespace Crypt { export interface Options { useHex?: true | false; useBase64?: true | false; } export type outputHash = "Hex" | "Base64"; export type inputHash = "Hex" | "Base64"; } }