UNPKG

@sibevin/random-token

Version:

A simple way to generate a random token.

15 lines (14 loc) 653 B
declare const DEFAULT_TOKEN_SIZE: number; declare const FRIENDLY_MASK: string; type Casing = null | "m" | "mixed" | "u" | "upper" | "l" | "lower"; type Seed = 10 | 1 | "n" | "number" | 8 | "o" | "oct" | "octal" | 2 | "b" | "binary" | 16 | "h" | "hex" | "hexadecimal" | "a" | "alphabet" | "l" | "letter" | string; type RandomTokenParams = { length?: number; seed?: Seed; casing?: Casing; friendly?: boolean; mask?: string; }; declare function gen(params?: RandomTokenParams): string; declare function genf(params?: RandomTokenParams): string; export { gen, genf, RandomTokenParams, Seed, Casing, DEFAULT_TOKEN_SIZE, FRIENDLY_MASK, };