import { Option } from './types'; import { Key } from './key'; /** * APIKey represents a compound key consisting of four parts or segments: * - Prefix: A company or application identifier (e.g., "AGNTSTNP") * - Key: A UUID-based identifier encoded in Base32-Crockford * - Entropy: Additional segment of random data for increased uniqueness * - Checksum: CRC32 checksum of the previous components (8 characters) * * Format: * * [Prefix]_[UUID Key][Entropy]_[Checksum] * * AGNTSTNP_38QARV01ET0G6Z2CJD9VA2ZZAR0XJJLSO7WBNWY3F_A1B2C3D8 * └─────┘ └──────────────────────────┘└────────────┘ └──────┘ * Prefix Key (crock32 UUID) Entropy Checksum */ export declare class APIKey { /** Prefix identifying the application or service */ prefix: string; /** Base32-Crockford encoded UUID */ key: Key; /** Additional entropy for uniqueness */ entropy: string; /** CRC32 checksum of other components */ checksum: string; constructor(prefix: string, key: Key, entropy: string, checksum: string); toString(): string; } /** * newAPIKey creates a new APIKey from a string prefix, string UUID, and option. */ export declare function newAPIKey(prefix: string, uuid: string, opt?: Option): APIKey; /** * Creates a new API key from a prefix and [16]byte UUID, and option. */ export declare function newAPIKeyFromBytes(prefix: string, uuid: Buffer, opt?: Option): APIKey; /** * Parses an API key string into an APIKey type. */ export declare function parse(apikey: string): APIKey;