Class: Uuid

types~ Uuid

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

Constructor

new Uuid(buffer)

Creates a new instance of Uuid based on a Buffer
Parameters:
Name Type Description
buffer Buffer The 16-length buffer.

Methods

(static) fromString(value) → {Uuid}

Parses a string representation of a Uuid
Parameters:
Name Type Description
value String
Returns:
Type
Uuid

(static) random() → {Uuid}

Creates a new random (version 4) Uuid.
Returns:
Type
Uuid

equals(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.

getBuffer() → {Buffer}

Gets the bytes representation of a Uuid
Returns:
Type
Buffer

inspect() → {string}

Provide the name of the constructor and the string representation
Returns:
Type
string

toJSON()

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

toString() → {String}

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
String