View Source AshDoubleEntry.ULID (ash_double_entry v1.0.6)
An Ash type for ULID strings.
Summary
Functions
Generates a binary ULID.
Generates a binary ULID.
Casts a string to ULID.
Converts a binary ULID into a Crockford Base32 encoded string.
Converts a Crockford Base32 encoded ULID into a binary.
Generates a Crockford Base32 encoded ULID.
Generates a Crockford Base32 encoded ULID, guaranteed to sort equal to or after any other ULID generated for the same timestamp.
The underlying schema type.
Types
@type t() :: <<_::208>>
A hex-encoded ULID string.
Functions
Generates a binary ULID.
If a value is provided for timestamp
, the generated ULID will be for the provided timestamp.
Otherwise, a ULID will be generated for the current time.
Arguments:
timestamp
: A Unix timestamp with millisecond precision.
Generates a binary ULID.
Do not use this for storage, only for generating comparators, i.e "balance as of a given ulid".
If a value is provided for timestamp
, the generated ULID will be for the provided timestamp.
Otherwise, a ULID will be generated for the current time.
Arguments:
timestamp
: A Unix timestamp with millisecond precision.
Casts a string to ULID.
Converts a binary ULID into a Crockford Base32 encoded string.
Converts a Crockford Base32 encoded ULID into a binary.
Generates a Crockford Base32 encoded ULID.
If a value is provided for timestamp
, the generated ULID will be for the provided timestamp.
Otherwise, a ULID will be generated for the current time.
Arguments:
timestamp
: A Unix timestamp with millisecond precision.
Generates a Crockford Base32 encoded ULID, guaranteed to sort equal to or after any other ULID generated for the same timestamp.
Do not use this for storage, only for generating comparators, i.e "balance as of a given ulid".
If a value is provided for timestamp
, the generated ULID will be for the provided timestamp.
Otherwise, a ULID will be generated for the current time.
Arguments:
timestamp
: A Unix timestamp with millisecond precision.
The underlying schema type.