heptapod-0.2024.8.16: Generate UUIDv7 values.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Heptapod

Description

This module provides functions for building and generating version 7 UUIDs as defined by section 5.7 of RFC 9562.

https://datatracker.ietf.org/doc/html/rfc9562#name-uuid-version-7

Synopsis

Documentation

generate :: IO UUID Source #

Generates a UUIDv7 using the current time (from getSystemTime) and random data (from getEntropy).

build Source #

Arguments

:: SystemTime

Corresponds to the unix_ts_ms field.

-> Word64

Corresponds to the rand_a field. Only the low 12 bits are used.

-> Word64

Corresponds to the rand_b field. Only the low 62 bits are used.

-> UUID 

Builds a UUIDv7 using the provided fields. Typically you will want to use the generate function instead.