///
import { Readable } from 'stream';
export declare const getU8ReversedLUT: () => number[];
export declare const getU8RightLUT: () => number[];
export declare const getU8LeftLUT: () => number[];
export declare const mask: (nbits: number) => number;
/** Return a resized copy of the passed buffer, by cropping or adding zeros. */
export declare function truncateBuf(buf: Buffer, size: number): Buffer;
export declare class BitQueue {
protected bits: number;
nbits: number;
constructor();
init(): void;
/** Push 8 bits to the queue. Bit 0 is pushed first, then 1, etc. */
push(bits: number): void;
/**
* Pop N bits from the queue.
* First consumed bit is placed on bit N-1, then bit N-2, ... bit 0
* If not enough bits are present,
*/
pop(nbits: number): number;
}
export declare class LRUCache {
readonly lastUsed: Uint32Array;
protected readonly value: Uint32Array;
protected readonly blockNumber: Uint32Array;
nentries: number;
constructor();
init(): void;
protected touch(entry: number): void;
/**
* Add a value to the cache.
* Returns true if an entry with that value already existed in the cache
*/
add(n: number): boolean;
/** Find an entry by its usage, then touch it and return its value, or undefined if not found */
find(usage: number): number | undefined;
/** Delete entries referring to oldest block (block 0) */
prune(): void;
}
export declare function rc4(key: Buffer): () => number;
/** Returns promise for the next N-byte chunk of a readable (paused) stream. */
export declare const readNext: (stream: Readable, n: number) => Promise;