Function getRandomString

  • Gets a string of random characters from a given alphabet

    Parameters

    • length: number

      The length of the resulting string

    • alphabet: string = DefaultAlphabet

      An string with characters used for random picks. Default Alphabet is alphanumeric without special chars

    Returns string

    A string with random characters of given length

    An error if alphabet is empty or too large (2^16 chars is limit)