import { Buffer } from 'buffer'; /** * Converts to utf-8 encoding and removes null characters. * * @param buf - the buffer, byte array, or string to convert to utf-8 encoding * * @returns utf-8 encoded string */ export declare const buf2String: (buf: Uint8Array | Buffer | number[]) => string; /** * Converts to utf-8 encoding and removes null characters. * * @param buf - the buffer, byte array, or string to convert to utf-8 encoding * * @returns utf-8 encoded string */ export declare const toUtf8: (buf: Uint8Array | Buffer | number[]) => string; /** * Determine whether a given string contains only base58 characters * @param value - the string to verify * @returns boolean indicating if a value is base58 encoded */ export declare const isBase58: (value: string) => boolean; /** * Determine whether a given string contains a secretKey Uint8Array * @param value - the string to verify * @param length - the minimum number of bytes enclosed in square brackets * @returns boolean indicating if a value contains a secretKey in byte array format */ export declare const isBytes: (value: string, length?: number) => boolean; /** * Determine whether a given string contains a secretKey Uint8Array * @param value - the string to verify * @param length - the minimum number of bytes enclosed in square brackets * @returns boolean indicating if a value contains a secretKey in byte array format */ export declare const isKeypairString: (value: string, length?: number) => boolean; /** * Determine whether a given string is hex encoded * @param value - the string to verify * @param length - the minimum number of characters following the 0x prefix * @returns boolean indicating if a value is a hex encoded string */ export declare const isHex: (value: string, length?: number) => boolean; /** * Converts a string to a hex string with 0x prefix. * * Supported input formats: * - Byte array string: "[1, 2, 3, ...]" * - Hex string: "0xabc123..." or "abc123..." * - Base64 string: "VGhpcyBpcyBhIHRlc3Qgc3RyaW5nLg==" * - Base58 string: "12DsSDs23..." * * @param value - The string to convert to hex * @returns A hex string with 0x prefix * @throws Error if the input cannot be decoded into a valid format * * @example * toHex("[1, 2, 3]") // returns "0x010203" * toHex("0xabc123") // returns "0xabc123" */ export declare const toHex: (value: string) => string; /** * Determine whether a given string is base64 encoded * @param value - the string to verify * @returns boolean indicating if a value is a base64 encoded string */ export declare const isBase64: (value: string, length?: number) => boolean; /** * Attempt to parse a string into a valid a buffer format. * * Accepted formats: * - byte array "[1, 2, 3, ...]" * - hex string "0xabc123..." * - base64 string "VGhpcyBpcyBhIHRlc3Qgc3RyaW5nLg==" * - base58 string "12DsSDs23..." * * @returns the parsed string in Buffer format or undefined if no regex matches found */ export declare const decodeString: (data: string) => Buffer | undefined; export type RawBuffer = string | Buffer | Uint8Array | number[]; export declare function parseMrEnclave(hexString: string): Uint8Array; export declare function parseRawMrEnclave(rawBuffer: RawBuffer, addMissingBytes?: boolean): Uint8Array; //# sourceMappingURL=string.d.ts.map