v1
v1(
options?):string
Defined in: src/uuid/v1.ts:24
Version 1 — a 60-bit timestamp, a clock sequence and a node ID (RFC 9562 §5.1).
The timestamp counts 100-nanosecond intervals since 1582-10-15, the date the Gregorian calendar was adopted. JavaScript has no access to a MAC address, so the node ID is random with the multicast bit set, which §6.10 requires so it cannot be mistaken for a real hardware address.
Prefer v7 for new work: it sorts as a string, where v1 does not.
Parameters
Section titled “Parameters”options?
Section titled “options?”TimeUuidOptions = {}
Returns
Section titled “Returns”string
Example
Section titled “Example”v1(); // "c232ab00-9414-11ec-b3c8-9f6bdeced846"
// Reproducible when you supply both the engine and the clock.import { xoshiro128pp } from "ransu/engine";v1({ engine: xoshiro128pp(42), now: 1645557742000 });