Cuid

Collision-resistant ids.

Usage:

# Start the generator
{:ok, generator} = Cuid.start_link

# Generate a new CUID
Cuid.generate(generator)
Source

Summary

generate(generator)

Generates and returns a new CUID

start_link(process_opts \\ [])

Starts a new generator

Functions

generate(generator)

Specs:

  • generate(generator :: pid) :: String.t

Generates and returns a new CUID.

Source
start_link(process_opts \\ [])

Specs:

  • start_link(process_opts :: list | nil) :: {:ok, pid} | {:error, term}

Starts a new generator.

Returns either {:ok, pid} or {:error, reason}

Source