Options
All
  • Public
  • Public/Protected
  • All
Menu

Module "random-id"

Index

Functions

Functions

Const randomID

  • randomID(len?: number, prefix?: string, syms?: string, rnd?: IRandom): string
  • Generates and returns a random string of len characters (default 4), plus optional given prefix and using only provided syms characters (default lowercase a-z).

    example
    randomID()
    "qgdt"
    
    randomID(8, "id-", "0123456789ABCDEF")
    "id-94EF6E1A"

    Parameters

    • Default value len: number = 4

      -

    • Default value prefix: string = ""

      -

    • Default value syms: string = "abcdefghijklmnopqrstuvwxyz"

      -

    • Default value rnd: IRandom = SYSTEM

      -

    Returns string

Generated using TypeDoc