UNPKG

tsid-ts

Version:

A TypeScript library for generating Time-Sorted Unique Identifiers (TSID).

24 lines (23 loc) 982 B
/** * Encodes a bigint value into a string representation using the specified base. * @param value - The bigint value to encode. * @param base - The base to use for encoding. * @param minLength - The minimum length of the encoded string. Optional. * @returns The encoded string. */ export declare function encode(value: bigint, base: number, minLength?: number): string; /** * Decodes a string value into a number using the specified base. * @param value The string value to decode. * @param base The base to use for decoding. * @returns The decoded number. */ export declare function decode(value: string, base: number): number; /** * Generates a random integer between min (inclusive) and max (inclusive). * * @param {number} min - The minimum value of the range. * @param {number} max - The maximum value of the range. * @returns {number} A random integer between min and max (inclusive). */ export declare function uniformInt(min: number, max: number): number;