WeightedRandom.Utils.Crypto (weighted_random v1.0.0-alpha.1)

Copy Markdown View Source

Based on this blog post run reseed, to generate a cryptographically secure seed for your random number generators.

I would actually suggest every elixir app should call this function at the beginning of it's startup process, even if the WeightedRandom library is not being used.

Usage

# my_app/lib/my_app/application.ex
defmodule MyApp.Application do
  use Application

  @impl true
  def start(_type, _args) do
    WeightedRandom.Utils.Crypto.reseed()
    children = [
      ...
    ]
    opts = [...]
    Supervisor.start_link(children, opts)
  end
end

Summary

Functions

reseed()