Hello everybody,
I propose adding a File.checksum/2 function to create a (md5/sha1/sha256/...) checksum of a given file path.
The function might have the following signature:
checksum(String.t, Atom.t) :: {:ok, String.t} | {:error, String.t}
- The first attribute is the path to the file where a checksum should be computed.
- The second attribute addresses the used hashing algorithm as an atom e.g. :md5, :sha, :sha256, according to the the algorithms provided by erlang.
After searching the web for quite a long time, it was hard to find a suitable AND efficient implementation of creating file checksums with Elixir.
Therefore, I’m convinced this function will help many developers creating file checksums.
Regards,
Matthias