generate
import { generate } from "jsr:@ende/uuid/v1";function
function generate(options: GenerateOptions = [UNSUPPORTED]): stringGenerates a UUIDv1.
options: GenerateOptions = [UNSUPPORTED]Can use RFC time sequence values as overwrites.
Returns
Returns a UUIDv1 string.
Example: Usage
import { generate, validate } from "@ende/uuid/v1";
import { assert } from "@ende/assert";
const options = {
node: [0x01, 0x23, 0x45, 0x67, 0x89, 0xab],
clockseq: 0x1234,
msecs: new Date("2011-11-01").getTime(),
nsecs: 5678,
};
const uuid = generate(options);
assert(validate(uuid));