antl_utils v0.4.1 AntlUtils.Ecto.UUID
Link to this section Summary
Link to this section Functions
Link to this function
to_hashid(uuid, prefix \\ nil)
Specs
Convert a uuid to a hashid.
Examples
iex> UUID.to_hashid("00000000-0000-0000-0000-000000000001") "1" iex> UUID.to_hashid("bc205f5c-a98d-473f-b186-b251cd60b23e") "5izLo84gcDU7IdJsOLe1D4" iex> UUID.to_hashid("bc205f5c-a98d-473f-b186-b251cd60b23e", "prefix") "prefix_5izLo84gcDU7IdJsOLe1D4"
Link to this function
to_uuid(hashid)
Specs
to_uuid(binary()) :: <<_::288>>
Convert a hashid to a uuid.
Examples
iex> UUID.to_uuid("5izLo84gcDU7IdJsOLe1D4") "bc205f5c-a98d-473f-b186-b251cd60b23e" iex> UUID.to_uuid("prefix_5izLo84gcDU7IdJsOLe1D4") "bc205f5c-a98d-473f-b186-b251cd60b23e"