View Source AshDoubleEntry.ULID (ash_double_entry v1.0.1)

An Ecto type for ULID strings.

Summary

Types

t()

A hex-encoded ULID string.

Functions

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.

The underlying schema type.

Types

@type t() :: <<_::208>>

A hex-encoded ULID string.

Functions

Link to this function

bingenerate(timestamp \\ System.system_time(:millisecond))

View Source

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.
Link to this function

cast_input(value, constraints)

View Source

Casts a string to ULID.

Converts a binary ULID into a Crockford Base32 encoded string.

Link to this function

dump_to_native(encoded, _)

View Source

Converts a Crockford Base32 encoded ULID into a binary.

Link to this function

generate(timestamp \\ System.system_time(:millisecond))

View Source

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.

The underlying schema type.