/** * Copyright 2025 The Lotusia Stewardship * Github: https://github.com/LotusiaStewardship * License: MIT */ import { Buffer } from 'buffer/'; /** * Validate a sha256 hash * @param str - The sha256 hash to validate * @returns Whether the sha256 hash is valid */ export declare function isSha256(str: string): boolean; /** * Convert a number or UTF-8 string to a hex string * @param data - The data to convert * @returns The hex string */ export declare function toHex(data: number | string | Buffer): string; /** * Check if a string is hex-encoded, with optional `length` limit * @param str The string to check * @param length The length of the hex string to check. If not defined, checks the full string * @returns `true` if the string is hex-encoded, `false` otherwise */ export declare function isHex(str: string, length?: number): boolean; /** * Check if a string is base64 encoded * @param str The string to check * @returns `true` if the string is base64 encoded, `false` otherwise */ export declare function isBase64(str: string): boolean; /** * Decode a base64-encoded string * @param str The base64 encoded string to decode * @returns The decoded string */ export declare function decodeBase64(str: string): string; /** * Encode a UTF-8 string to a base64-encoded string. Optionally provide a different * encoding scheme for the input string * @param str The string to encode * @returns The base64 encoded string */ export declare function encodeBase64(str: string, encoding?: BufferEncoding): string; /** * Truncate a sha256 hash to 16 + 6 characters * @param sha256 - The sha256 hash to truncate * @returns The truncated sha256 hash */ export declare function truncateSha256(sha256: string): string; /** * Truncate a transaction id to 16 + 6 characters * @param txid - The transaction id to truncate * @returns The truncated transaction id */ export declare function truncateTxid(txid: string): string; /** * Truncate an address to 17 + 6 characters * @param address - The address to truncate * @returns The truncated address */ export declare function truncateAddress(address: string): string; /** * Truncate a block hash to 1 + 16 characters * @param blockHash - The block hash to truncate * @returns The truncated block hash */ export declare function truncateBlockHash(blockHash: string): string; //# sourceMappingURL=string.d.ts.map