database/uuid

UUID helper module for encoding a bit_string into a regular string Most code translated from elixir here: https://github.com/elixir-ecto/ecto/blob/30311c21cb40f39dbbc148e58ff1ed3cac951ea1/lib/ecto/uuid.ex#L179-L188

Functions

pub fn cast(binary: BitString) -> Result(String, Nil)

Casts a bit_string into a regular string

Examples

cast(<<73, 159, 108, 135, 102, 203, 67, 106, 159, 57, 176, 178, 81, 149, 27, 34>>)
Ok("499f6c87-66cb-436a-9f39-b0b251951b22")

cast(<<0, 1, 2, 3>>)
Error(Nil)
Search Document