A universally-unique, lexicographically-sortable, identifier generator
78
Build a function that generates sequential, ordered identifiers for a high-frequency event logging system. The identifiers must maintain strict lexicographic ordering even when multiple events occur within the same millisecond.
Your implementation must:
@generates
/**
* Creates an ordered ID generator
* @returns A generator function that produces ordered IDs
*/
export function createOrderedIdGenerator(): IdGenerator;
/**
* ID generator function type
* @param timestamp - Optional timestamp in milliseconds (default: current time)
* @returns A unique, ordered identifier string
*/
export type IdGenerator = (timestamp?: number) => string;Provides identifier generation with sortable properties.
@satisfied-by
Install with Tessl CLI
npx tessl i tessl/npm-ulidevals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10