Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def md5_digest_for_file_at_path(file_path) do
- File.stream!(file_path, [:read, :binary], 1024 * 1024)
- |> Stream.chunk(1)
- |> Enum.reduce(
- :crypto.hash_init(:md5),
- fn(chunk, acc) ->
- :crypto.hash_update(acc, hd(chunk))
- end)
- |> :crypto.hash_final
- |> Base.encode16
- |> String.downcase
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement