licence_audit/sbom_uuid

Types

pub type Error {
  InsufficientBytes
}

Constructors

  • InsufficientBytes

Values

pub fn reproducible_timestamp() -> String

The reproducible timestamp string: SOURCE_DATE_EPOCH formatted as a UTC RFC 3339 instant, falling back to 1970-01-01T00:00:00Z when unset.

pub fn resolve_source_date_epoch(raw: Result(String, Nil)) -> Int

Resolve the reproducible-build timestamp (seconds since the Unix epoch) from a SOURCE_DATE_EPOCH value. Follows the reproducible-builds convention: a missing, non-numeric, or negative value falls back to epoch 0.

pub fn serial_number() -> Result(String, Error)

Generate a CycloneDX-compatible urn:uuid:<v4> serial number.

pub fn serial_number_from_content(
  content: String,
) -> Result(String, Error)

Derive a deterministic urn:uuid serial number from arbitrary BOM content.

The content is hashed with SHA-256 and the first 16 bytes are formatted as an RFC 9562 version-8 (custom) UUID. Identical content always yields the same serial number, so two SBOMs generated from the same dependency set compare equal — while a change anywhere in the content changes the serial.

pub fn timestamp_now() -> String

Current UTC time as an RFC 3339 string with a trailing Z (seconds precision), e.g. 2026-05-24T22:51:00Z.

pub fn timestamp_of_epoch(seconds: Int) -> String

Format the given number of seconds since the Unix epoch as a UTC RFC 3339 instant (e.g. 0 -> 1970-01-01T00:00:00Z).

✨ Search Document