/** * Represents a hash primitive that provides various cryptographic hashing capabilities. * This class handles conversions between different formats (bytes, hex, UTF-8) and * supports multiple hashing algorithms (SHA256, RIPEMD160, Hash160, Hash256). */ export declare class Hasher { bytes: Uint8Array; /** * Creates a new Hash instance. * @param bytes - The byte array representation of the data to be hashed */ constructor(bytes: Uint8Array); /** * Creates a Hash instance from a byte array. * @param bytes - The byte array to create the hash from * @returns A new Hash instance containing the provided bytes */ static fromBytes(bytes: Uint8Array): Hasher; /** * Creates a Hash instance from a Base64 string. * @param base64 - The Base64 string to create the hash from * @returns A new Hash instance containing the bytes converted from the Base64 string * @throws {Error} If the provided string is not valid Base64 */ static fromBase64(base64: string): Hasher; /** * Creates a Hash instance from a hexadecimal string. * @param hex - The hexadecimal string to create the hash from * @returns A new Hash instance containing the bytes converted from the hex string * @throws {Error} If the provided string is not valid hexadecimal */ static fromHex(hex: string): Hasher; /** * Creates a Hash instance from a UTF-8 string. * @param utf8 - The UTF-8 string to create the hash from * @returns A new Hash instance containing the bytes converted from the UTF-8 string */ static fromUTF8(utf8: string): Hasher; /** * Computes the SHA256 hash of the stored bytes. * @returns A Uint8Array containing the SHA256 hash */ toSHA256Bytes(): Uint8Array; /** * Computes the SHA256 hash of the stored bytes and returns it as a hexadecimal string. * @returns The SHA256 hash as a hexadecimal string */ toSHA256Hex(): string; /** * Computes the RIPEMD160 hash of the stored bytes. * @returns A Uint8Array containing the RIPEMD160 hash */ toRIPEMD160Bytes(): Uint8Array; /** * Computes the RIPEMD160 hash of the stored bytes and returns it as a hexadecimal string. * @returns The RIPEMD160 hash as a hexadecimal string */ toRIPEMD160Hex(): string; /** * Computes the Hash160 (RIPEMD160(SHA256(x))) of the stored bytes. * This is commonly used in cryptocurrency addresses. * @returns A Uint8Array containing the Hash160 value */ toHash160Bytes(): Uint8Array; /** * Computes the Hash160 (RIPEMD160(SHA256(x))) of the stored bytes and returns it as a hexadecimal string. * @returns The Hash160 value as a hexadecimal string */ toHash160Hex(): string; /** * Computes the Hash256 (SHA256(SHA256(x))) of the stored bytes. * This is commonly used for computing block hashes in Bitcoin. * @returns A Uint8Array containing the Hash256 value */ toHash256Bytes(): Uint8Array; /** * Computes the Hash256 (SHA256(SHA256(x))) of the stored bytes and returns it as a hexadecimal string. * @returns The Hash256 value as a hexadecimal string */ toHash256Hex(): string; }