defmodule SData do @moduledoc """ Utility functions """ @doc """ Calculate the hash of an Erlang term by first converting it to its binary representation. """ def term_hash(term, algo \\ :sha256) do :crypto.hash(algo, (:erlang.term_to_binary term)) end end