This site uses cookies. To consent, continue navigating this site or click the "Accept cookies" button.

Options
All
  • Public
  • Public/Protected
  • All
Menu

short-unique-id - v3.0.4

Index

Classes

Type aliases

Variables

Type aliases

Options

Options: { debug: boolean; dictionary: string[]; length: number; shuffle: boolean }
{
  dictionary: ['z', 'a', 'p', 'h', 'o', 'd', ...],
  shuffle: false,
  debug: false,
  length: 6,
}

Type declaration

  • debug: boolean

    If true the instance will console.log useful info

  • dictionary: string[]

    User-defined character dictionary

  • length: number

    From 1 to infinity, the length you wish your UUID to be

  • shuffle: boolean

    If true, sequentialUUID use the dictionary in the given order

Variables

Const DEFAULT_UUID_LENGTH

DEFAULT_UUID_LENGTH: number = 6

6 was chosen as the default UUID length since for most cases it will be more than aptly suitable to provide millions of UUIDs with a very low probability of producing a duplicate UUID.

For example, with a dictionary including digits from 0 to 9, as well as the alphabet from a to z both in UPPER and lower case, the probability of generating a duplicate in 1,000,000 rounds is ~0.00000002, or about 1 in 50,000,000.