Skip to main content

Module util

Module util 

Source
Expand description

Shared utilities used across multiple crates.

These live in pylon-kernel because core has no I/O dependencies and is already a dependency of every other crate.

Functions§

epoch_to_iso
Convert Unix-epoch seconds to an ISO-8601 string.
is_leap
Check if a year is a leap year.
is_safe_file_id
Returns true if a user-provided file ID is safe to use as a path component. Rejects empty strings, .., slashes, and dotfiles.
now_iso
Current UTC time as an ISO-8601 string (second precision).
quote_ident
Quote a SQL identifier with double quotes to prevent injection. Embedded double quotes are escaped by doubling them (SQL standard, works in SQLite and Postgres).