Expand description
Timestamps as pi writes them: Unix milliseconds and ISO 8601 UTC with milliseconds, and ids.
Functions§
- hex
bytesas lowercase hexadecimal.- iso
2026-10-02T14:49:48.573Z, as JavaScript’sDate.toISOString.- now_iso
- The current time as
iso. - now_ms
- Unix time in milliseconds.
- parse_
iso - Parses
isooutput, and offsets other thanZ, to Unix milliseconds. - random_
bytes Nbytes from the OS generator. Panics when it fails, as Node’s crypto throws, so ids never repeat.- random_
hex countrandom bytes as lowercase hexadecimal; panics asrandom_bytesdoes.- try_
random_ bytes Nbytes from the OS generator, or why it failed.- try_
uuid_ v4 - A random UUID v4, or why the OS generator failed.
- uuid_v4
- A random UUID v4, as
crypto.randomUUID; panics asrandom_bytesdoes. - uuid_v7
- A time-ordered UUID v7, used for session ids; panics as
random_bytesdoes.