This factory holds a static method to build UUIDs.

As UUIDs strongly rely on random numbers, a random number generation method is also provided.


Factories

Hierarchy

  • UUIDFactory

Constructors

Methods

Constructors

Methods

  • Generates a random number in the range [0,1[.

    Depending on your platform, the function may use cryptographic functions or use Math.random.

    Returns

    A random number in the range [0,1[.

    Returns number

  • Generates an new UUID string in the form xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx if pFormatted or xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx if not pFormatted where x is in the set [0-9a-f].

    Returns

    A random UUID string.

    Parameters

    • pFormatted: boolean
      in
      If true, the uuid string will contain "-".

    Returns string