diff options
Diffstat (limited to 'lib/data/data.ex')
-rw-r--r-- | lib/data/data.ex | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/data/data.ex b/lib/data/data.ex new file mode 100644 index 0000000..2c6e629 --- /dev/null +++ b/lib/data/data.ex @@ -0,0 +1,14 @@ +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) do + :crypto.hash(:sha256, (:erlang.term_to_binary term)) + end + +end |