UNPKG

@confluxfans/cip-23

Version:

Tiny library with utility functions that can help with signing and verifying CIP-23 based messages

19 lines (18 loc) 911 B
/// <reference types="node" /> /** * Hashes the data with the optional encoding specified. If no encoding is specified, it is assumed that the data is * already a Buffer. * * @param {string | Buffer} data * @param {BufferEncoding} [encoding] * @return {Buffer} */ export declare const keccak256: (data: string | Buffer, encoding?: "ascii" | "utf8" | "utf-8" | "utf16le" | "ucs2" | "ucs-2" | "base64" | "latin1" | "binary" | "hex" | undefined) => Buffer; /** * Get a string as Buffer, with the optional encoding specified. If no encoding is specified, it is assumed that the * data is a hexadecimal string. The string can optionally contain the 0x prefix. * * @param {string} data * @param {BufferEncoding} encoding */ export declare const toBuffer: (data: string, encoding?: "ascii" | "utf8" | "utf-8" | "utf16le" | "ucs2" | "ucs-2" | "base64" | "latin1" | "binary" | "hex" | undefined) => Buffer;