Represents an immutable universally unique identifier (UUID). A UUID represents a 128-bit value.

Constructor

new

Uuid

(Buffer buffer)

Creates a new instance of Uuid based on a Buffer

Parameters:
Name Type Description
buffer Buffer

The 16-length buffer.

Methods

equals

(Uuid other)

Compares this object to the specified object. The result is true if and only if the argument is not null, is a UUID object, and contains the same value, bit for bit, as this UUID.

Parameters:
Name Type Description
other Uuid

The other value to test for equality.

Uuid.fromString

(String value)

Parses a string representation of a Uuid

Static
This function is static
Parameters:
Name Type Description
value String
Returns:
Type Description
Uuid

getBuffer

()

Gets the bytes representation of a Uuid

Returns:
Type Description
Buffer

inspect

()

Provide the name of the constructor and the string representation

Returns:
Type Description
string

Uuid.random

([function callback])

Creates a new random (version 4) Uuid.

Static
This function is static
Parameters:
Name Type Description
callback optional function

Optional callback to be invoked with the error as first parameter and the created Uuid as second parameter.

Returns:
Type Description
Uuid

toJSON

()

Returns the string representation. Method used by the native JSON.stringify() to serialize this instance.

toString

()

Returns a string representation of the value of this Uuid instance. 32 hex separated by hyphens, in the form of 00000000-0000-0000-0000-000000000000.

Returns:
Type Description
String