blob: 428957c6ccc7cfc0b6f6ce3083443f948cae9a90 (
plain) (
tree)
|
|
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
|