import { v7 } from "https://deno.land/x/uuid7@v0.0.1/mod.ts";
Generate a UUIDv7.
Options
To generate a UUID at a specific time, you can pass a number
timestamp or
Date
object to this function.
You can also further customize UUID generation by providing an object with your preferences:
time
: Generate with this time instead of the current system time. You can provide anumber
millisecond-precision UNIX timestamp (asDate.now
returns), a Date object, or a function returning anumber
timestamp.dashes
:true
to include-
characters in the generated UUID string;false
to omit them. (default:true
)upper
: Capitalize the A-F characters in the UUID. (default:false
)version
: The value of the UUIDversion
field (default:7
)entropy
: A function to generate the random part of the UUID. Must return aUint8Array
containing 10 bytes. (default: usescrypto.getRandomValues
)