import type { DecodeResult, WordHandleProfile, WordHandleProfileName } from './types.js'; /** Identifier of the lexicon layout profile used by this codec. */ export declare const LEXICON_PROFILE = "single-list-v1"; /** * Built-in word handle profiles. Word count = dataWords + checksumWords; * prefixBits = 11 * dataWords. * * compact: 4+1 (44 bits). Set-scoped display ONLY; render-time * uniqueness plus lengthening is mandatory * (minUniquePrefixBits is the tool). * default: 6+1 (66 bits). Minimum for any cross-set reference. * high_assurance: 8+2 (88 bits). Archival and adversarial contexts. */ export declare const PROFILES: Readonly>; /** * Encode the first `prefixBits` bits of `input` as a word_digest_handle: * prefixBits/11 data words followed by `checksumWords` checksum words. * * `input` is raw bytes or a hex string; a leading "sha256:" prefix on * hex input is stripped. Throws when prefixBits is not a positive * multiple of 11, when the input supplies fewer than prefixBits bits, * or when checksumWords is not 1 or 2. */ export declare function encode(input: Uint8Array | string, prefixBits?: number, checksumWords?: number): string[]; /** Encode with a named profile (prefixBits and checksumWords from the table). */ export declare function encodeProfile(input: Uint8Array | string, profile: WordHandleProfileName): string[]; /** * Decode a word_digest_handle. Never throws on unknown words (reported * via `outOfLexicon`); throws when checksumWords is not 1 or 2 or when * the word count leaves no data words. * * `prefixHex` is the full packed prefix, 2*ceil(prefixBits/8) lowercase * hex characters with trailing pad bits zero; `prefixBits` is returned * so consumers compare BIT-scoped, never by raw string beyond * prefixBits. Localization (`failedWordIndex`) is best effort and only * attempted when the checksum fails and every word is in the lexicon. * See DecodeResult for the exact rules. */ export declare function decode(words: readonly string[], checksumWords?: number): DecodeResult; /** * Decode with a named profile. Throws when the word count does not * match the profile shape (dataWords + checksumWords). */ export declare function decodeProfile(words: readonly string[], profile: WordHandleProfileName): DecodeResult; /** * Smallest multiple of 11 that is >= startBits such that the leading * prefixes of all digests are pairwise BIT-distinct at that length. * * Hex inputs may carry "sha256:" prefixes (stripped) and are compared * case-insensitively. Throws on empty input or duplicate full digests * (no prefix length can separate identical digests). */ export declare function minUniquePrefixBits(digestsHex: readonly string[], startBits?: number): number; //# sourceMappingURL=codec.d.ts.map