• Generate a Random String

    Parameters

    • Optional options: {
          exclude?: string[];
          length?: number;
          lowercase?: boolean;
          numbers?: boolean;
          symbols?: boolean;
          uppercase?: boolean;
      }
      • Optional exclude?: string[]

        Letters / Symbols that shouldnt be included

        Default

        []
        

        Since

        1.0.0

      • Optional length?: number

        The Length of the String

        Default

        12
        

        Since

        1.0.0

      • Optional lowercase?: boolean

        Whether Lowercase Letters should be included

        Default

        true
        

        Since

        1.0.0

      • Optional numbers?: boolean

        Whether Numbers should be included

        Default

        true
        

        Since

        1.0.0

      • Optional symbols?: boolean

        Whether Symbols should be included

        Default

        false
        

        Since

        1.0.0

      • Optional uppercase?: boolean

        Whether Uppercase Letters should be included

        Default

        true
        

        Since

        1.0.0

    Returns string

    Example

    import { string } from "@rjweb/utils"

    string.generate({ length: 5, numbers: true, ... }) // fgD43

    Since

    1.0.0

    Supports

    nodejs, browser