View Source PrefixedUUID (PrefixedUUID v1.0.0)

Generates prefixed base62 encoded UUIDv7. https://danschultzer.com/posts/prefixed-base62-uuidv7-object-ids-with-ecto

Examples

@primary_key {:id, PrefixedUUID, prefix: "acct", autogenerate: true}
@foreign_key_type PrefixedUUID

Summary

Functions

Take an encode prefixed UUID string and split it into prefix and decoded UUID.

Types

Functions

@spec generate(String.t()) :: String.t()
@spec prefix(map()) :: String.t()
@spec slug_to_uuid(String.t()) :: {:ok, String.t(), String.t()} | :error

Take an encode prefixed UUID string and split it into prefix and decoded UUID.

Examples

iex> PrefixedUUID.slug_to_uuid("test_3TUIKuXX5mNO2jSA41bsDx")
{:ok, "test", "7232b37d-fc13-44c0-8e1b-9a5a07e24921"}
Link to this function

uuid_to_slug(uuid, params)

View Source
@spec uuid_to_slug(String.t(), map()) :: String.t()