UNPKG

xud

Version:
21 lines (20 loc) 803 B
/// <reference types="node" /> /** A promisified wrapper for the NodeJS `crypto.randomBytes` method. */ export declare const randomBytes: (arg1: number) => Promise<Buffer>; /** * Encrypts a Buffer or base64 string using a password * @param payload a Buffer or base64 string * @returns an encrypted Buffer */ export declare function encrypt(payload: Buffer | string, password: string): Promise<Buffer>; /** * Decrypts a Buffer or base64 string using a password * @param payload a Buffer or base64 string * @returns a decrypted Buffer */ export declare function decrypt(payload: Buffer | string, password: string): Buffer; /** Returns a random payment preimage and hash in hex encoding. */ export declare function generatePreimageAndHash(): Promise<{ rPreimage: string; rHash: string; }>;