export declare const SIMPLEFLAKE_EPOCH = 946684800000n; /** * Generates a simpleflake ID * @param timestamp - Timestamp in milliseconds (defaults to current time) * @param randomBits - Random bits for the ID (defaults to a cryptographically secure random value) * @param epoch - Epoch timestamp in milliseconds (defaults to SIMPLEFLAKE_EPOCH) * @returns Generated simpleflake as a BigInt * @remarks * - Collision envelope: the 23-bit random field is a birthday-bound space, not a * sequence counter — ~1% collision probability at ~410 IDs/ms and ~50% at ~3,400 * IDs/ms from a single uncoordinated generator. Suitable for up to roughly a few * hundred IDs/ms per generator; higher throughput needs a different algorithm * (e.g. Snowflake's machine/sequence bits, or ULID's 80 random bits), not a parameter tweak. * - Epoch horizon: the default 41-bit timestamp (from the 2000-01-01 epoch) is * exhausted around September 2069. * - Same-millisecond ordering: IDs generated within the same millisecond are not * guaranteed to be numerically ordered by generation order — there is no sequence bit. */ export declare function simpleflake(timestamp?: number | bigint, randomBits?: number | bigint, epoch?: number | bigint): bigint; /** * Converts a value to binary representation * @param value - The value to convert to binary * @param padding - Whether to pad to 64 bits (defaults to true) * @returns Binary string representation */ export declare function binary(value: bigint | number | string, padding?: boolean): string; /** * Extracts bits from a data value * @param data - The data to extract bits from * @param shift - Number of bits to shift * @param length - Number of bits to extract * @returns Extracted bits as a BigInt */ export declare function extractBits(data: bigint | number | string, shift: bigint | number, length: bigint | number): bigint; /** * Structure representing a parsed simpleflake */ export declare class SimpleflakeStruct { readonly timestamp: bigint; readonly randomBits: bigint; constructor(timestamp: bigint, randomBits: bigint); } /** * Parses a simpleflake into its components * @param flake - The simpleflake to parse * @param epoch - Epoch timestamp in milliseconds used to reconstruct the absolute timestamp * @returns SimpleflakeStruct containing timestamp and random bits */ export declare function parseSimpleflake(flake: bigint | number | string, epoch?: bigint | number): SimpleflakeStruct; declare const _default: { binary: typeof binary; extractBits: typeof extractBits; parseSimpleflake: typeof parseSimpleflake; SIMPLEFLAKE_EPOCH: bigint; simpleflake: typeof simpleflake; SimpleflakeStruct: typeof SimpleflakeStruct; }; export default _default; //# sourceMappingURL=simpleflakes.d.ts.map