UNPKG

deterministic-trilabel

Version:

🔗 Deterministic Trilabel Generate human-readable, deterministic URLs for multi-tenant applications. Instead of random strings or UUIDs, create memorable URLs like "happy-jump-cloud" that are: ✨ Deterministic - Same input always produces the same URL 🎯

25 lines (24 loc) • 899 B
export type Letter = 'a' | 'b' | 'c' | 'd' | 'e' | 'f' | 'g' | 'h' | 'i' | 'j' | 'k' | 'l' | 'm' | 'n' | 'o' | 'p' | 'q' | 'r' | 's' | 't' | 'u' | 'v' | 'w' | 'x' | 'y' | 'z'; export interface ValidationRules { readonly minLength: number; readonly maxLength: number; readonly pattern: RegExp; readonly reservedPatterns: Array<{ clientPattern: RegExp; routePattern: RegExp; reason: string; }>; } export interface WordCollections { [key: string]: string[]; } export interface SystemCapacity { readonly nouns: number; readonly verbs: number; readonly adjectives: number; readonly totalCombinations: number; readonly bitsOfEntropy: number; readonly maxUrlLength: number; } export type GenerateUrlFunction = (clientName: string, routeName: string) => string; export type CalculatePotentialVariationsFunction = () => SystemCapacity;