Rocky_Mountain_Vending/.pnpm-store/v10/files/77/ee191de10f26476bd44b1a69304be2b57bc98cfa631441d1478041520981c10e8e67d4d7b2e44a9cdc7c260db1bb3706bbbdb48173364f9d4953dc9d095adf
DMleadgen 46d973904b
Initial commit: Rocky Mountain Vending website
Next.js website for Rocky Mountain Vending company featuring:
- Product catalog with Stripe integration
- Service areas and parts pages
- Admin dashboard with Clerk authentication
- SEO optimized pages with JSON-LD structured data

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-12 16:22:15 -07:00

79 lines
2.3 KiB
Text

import { BaseHashInput, IBaseHashOptions } from './hash-fn';
import { IHashReader } from './hash-reader';
/**
* A blake3 hash. Quite similar to Node's crypto hashing.
*
* Note that you must call {@link IHash#dispose} or {@link IHash#done} when
* you're finished with it to free memory.
*/
export interface IHasher<T> {
/**
* Adds the given data to the hash.
* @throws {Error} if {@link IHash#digest} has already been called.
*/
update(data: BaseHashInput): this;
/**
* Returns a digest of the hash.
*
* If `dispose: false` is given in the options, the hash will not
* automatically be disposed of, allowing you to continue updating
* it after obtaining the current reader.
*/
digest(options?: IBaseHashOptions & {
dispose?: boolean;
}): T;
/**
* Returns a {@link HashReader} for the current hash.
*
* If `dispose: false` is given in the options, the hash will not
* automatically be disposed of, allowing you to continue updating
* it after obtaining the current reader.
*/
reader(options?: {
dispose?: boolean;
}): IHashReader<T>;
/**
* Frees data associated with the hash. This *must* be called if
* {@link IHash#digest} is not called in order to free memory.
*/
dispose(): void;
}
/**
* @hidden
*/
export interface IInternalHash<Reader> {
free(): void;
reader(): Reader;
update(bytes: Uint8Array): void;
digest(into: Uint8Array): void;
}
export interface IHasherDigestOptions extends IBaseHashOptions {
dispose?: boolean;
}
/**
* Base implementation of hashing.
*/
export declare class BaseHash<Binary extends Uint8Array, InternalReader, Reader extends IHashReader<Binary>> implements IHasher<Binary> {
private readonly alloc;
private readonly getReader;
private hash;
constructor(implementation: IInternalHash<InternalReader>, alloc: (length: number) => Binary, getReader: (internal: InternalReader) => Reader);
/**
* @inheritdoc
*/
update(data: BaseHashInput): this;
/**
* @inheritdoc
*/
digest({ length, dispose }?: IHasherDigestOptions): Binary;
/**
* @inheritdoc
*/
reader({ dispose }?: {
dispose?: boolean;
}): Reader;
/**
* @inheritdoc
*/
dispose(): void;
}