Created
January 5, 2016 01:45
-
-
Save hamiltop/0c83ada42b5557b9785a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[file | _ ] = System.argv | |
file_stream = File.stream!(file) | |
context = :crypto.hash_init(:md5) | |
context = Enum.reduce(file_stream, context, fn (data, cxt) -> | |
:crypto.hash_update(cxt, data) | |
end) | |
int_value = :binary.decode_unsigned :crypto.hash_final(context) | |
IO.puts String.downcase Integer.to_string(int_value, 16) |
Author
hamiltop
commented
Jan 5, 2016
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment