Hierarchy

  • UUID

Constructors

  • Constructs a new UUID using the specified data.

    Parameters

    • mostSigBits: Buffer

      The most significant bits of the UUID

    • leastSigBits: Buffer

      The least significant bits of the UUID

    Returns UUID

Properties

bytes: Buffer

Buffer containing the bytes for this UUID

stringCache: { dashes?: string; noDashes?: string }

Object containing results of the .toString method. The .toString executes regex to check for string validity and can be slow when used multiple times. These cached values avoids multiple executions of the regex.

Type declaration

  • Optional dashes?: string
  • Optional noDashes?: string

Accessors

  • get variant(): number
  • The variant for this UUID

    Returns number

  • get version(): number
  • The version for this UUID

    Returns number

Methods

  • This method is executed when the UUID instance is used in a "primitive context".

    Example

    const uuid = new UUID(...);

    // Without this method
    console.log('UUID: ' + uuid); // -> 'UUID: [object Object]'

    // With this method
    console.log('UUID: ' + uuid); // -> 'UUID: 7ed9e77e-34b8-400e-b684-9093c550b4f9'

    Returns

    A string containing the UUID

    Returns string

  • The least significant 64 bits of this UUID's 128 bit value

    Returns Buffer

  • The most significant 64 bits of this UUID's 128 bit value

    Returns Buffer

  • Converts this UUID instance to a JSON valid format

    Parameters

    • dashes: boolean = true

    Returns string

  • Converts this UUID instance to a serializable string

    Parameters

    • dashes: boolean = true

    Returns string

Generated using TypeDoc