Skip to main content
Module

x/ui7/mod.ts

Generate UUIDv7 identifiers in JavaScript (or TypeScript)
Latest
import * as ui7 from "https://deno.land/x/ui7@v0.2.3/mod.ts";

Classes

The exception thrown by timestamp if UUID parsing fails.

Variables

A buffered EntropySource. To reduce overhead, bufferedRandom calls the underlying getRandomValues in chunks of blockSize, returning the already-generated random bytes for future reads until the block is exhausted.

Generate a UUIDv7.

Create a UUID generator. By default, uses a monotonic entropy source. Accepts the same options as the default generator.

Return an entropy source that allocates 12 bits as a monotonic counter at the start of the UUIDv7 random fields.

A regular expression that recognizes UUID's generated by this package.

Fill the UUID's rand fields with random bits, using [getRandomValues][random]. UUID's produced with this randomness source are not monotonic; ID's produced within the same millisecond will not necessarily be sortable in the order they were produced.

Return the timestamp portion of the UUID (a millisecond-precision UNIX timestamp, as returned by Date.now).

Generate a UUIDv7.

Interfaces

Configures how the "random" fields of a generated UUID are populated.

Configures how a generated UUID is formatted.

The type of the UUID function of this package.

Configures a UUID generator.

UUID generation options.

Type Aliases

A function that returns a millisecond-precision UNIX timestamp, like Date.now.

A source for the rand fields of a UUID. To implement monotonic or other counter-based rand fields, the UUID's timestamp is provided.

A Date object or millisecond-precision UNIX timestamp.