defmodule Ulid.Binary do @moduledoc """ Generates binary ULIDs. """ alias Ulid.Rand @typedoc """ A 128 bit ULID consisting of: * 48 bits millisecond timestamp * 80 bits of randomness """ @type t() :: binary() @doc """ Generates a binary ULID. ## Examples iex> ulid = Ulid.Binary.generate() iex> <<_::size(128)>> = ulid """ @spec generate(integer()) :: t() def generate(timestamp \\ System.system_time(:millisecond)) do <> end end