@ckb-ccc/core
Version:
Core of CCC - CKBer's Codebase
41 lines • 1.14 kB
TypeScript
import { BytesLike } from "../bytes/index.js";
import { Hex } from "../hex/index.js";
import { Hasher } from "./hasher.js";
/**
* @public
*/
export declare class HasherKeecak256 implements Hasher {
private readonly hasher;
/**
* Creates an instance of Hasher.
*/
constructor();
/**
* Updates the hash with the given data.
*
* @param data - The data to update the hash with.
* @returns The current Hasher instance for chaining.
*
* @example
* ```typescript
* const hasher = new Hasher();
* hasher.update("some data").update("more data");
* const hash = hasher.digest();
* ```
*/
update(data: BytesLike): HasherKeecak256;
/**
* Finalizes the hash and returns the digest as a hexadecimal string.
*
* @returns The hexadecimal string representation of the hash.
*
* @example
* ```typescript
* const hasher = new Hasher();
* hasher.update("some data");
* const hash = hasher.digest(); // Outputs something like "0x..."
* ```
*/
digest(): Hex;
}
//# sourceMappingURL=hasherKeecak256.d.ts.map