Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

Uuid

import { Uuid } from "https://raw.githubusercontent.com/i-xi-dev/uuid.es/3.2.2/mod.ts";

The object representation of UUID. The Uuid instances are immutable.

Implements version 4 UUID.

class Uuid {
private constructor(bytes: Uint8Array);
get type(): number;
get variant(): number;
get subtype(): number;
get version(): number;
get unixTimeMilliseconds(): number;
 
equals(other: Uuid | string): boolean;
format(options?: Uuid.FormatOptions): string;
toJSON(): string;
toString(): string;
toURN(): URL;
 
static async fromName(
namespace: string | Uuid,
name: string,
subtype?: 3 | 5,
): Promise<Uuid>;
static fromString(uuidString: string): Uuid;
static generateRandom(): Uuid;
static generateUnixTimeBased(): Uuid;
static nil(): Uuid;
}

§Constructors

§
new Uuid(bytes: Uint8Array) private
[src]

§Properties

§
type: number readonly
[src]

Gets the variant of this UUID.

§
variant: number readonly
[src]

The alias for the type getter.

§
subtype: number readonly
[src]

Gets the version of this UUID.

§
version: number readonly
[src]

The alias for the subtype getter.

§
unixTimeMilliseconds: number readonly
[src]

Timestamp of when the UUID was generated if the UUID version is 7. If the UUID version is not 7, returns NaN.

§Methods

§
equals(other: Uuid | string): boolean
[src]

Determines whether this UUID is equal to the UUID represented by another object.

@param other
  • The object or string that represents a UUID.
@return

If this is equal to the specified UUID, true; otherwise, false.

§
format(options?: Uuid.FormatOptions): string
[src]

Returns a string representation of this UUID.

@param options
  • The UuidFormat.Options dictionary.
@return

A string representation of this UUID.

§
toJSON(): string
[src]

The alias for the toString method.

@return

A string that represents the UUID.

§
toString(): string
[src]

Returns a string that represents the UUID.

@return

A string that represents the UUID.

§
toURN(): URL
[src]

Returns an URN that represents the UUID.

@return

An URN that represents the UUID.

§Static Methods

§
fromName(namespace: string | Uuid, name: string, subtype?: 3 | 5): Promise<Uuid>
[src]

Creates an Uuid object that represents the version 5 or 3 UUID.

@param namespace
  • The UUID to be used as namespace ID.
@param name
  • The name.
@param subtype
  • The version. Defaults to 5 if omitted.
@return

An Uuid object that represents the version 5 or 3 UUID.

§
fromString(uuidString: string): Uuid
[src]

Creates an Uuid object from a string that represents the UUID.

@return

An Uuid object.

§
generateRandom(): Uuid
[src]

Creates an Uuid object that represents the version 4 UUID.

@return

An Uuid object that represents the version 4 UUID.

§
generateUnixTimeBased(): Uuid
[src]

Creates an Uuid object that represents the version 7 UUID proposal.

§
nil(): Uuid
[src]

Creates an Uuid object that represents the nil UUID.

@return

An Uuid object that represents the nil UUID.

§Variables

Uuid.Namespace

§Type Aliases

Uuid.FormatOptions

The object with the following optional fields.