torrex v0.1.2 Torrex.FileUtils

Torrent-related file helpers.

Summary

Functions

Encodes the sha1 hash for the parts of a file or list of files in a single binary

Calculates the md5 of a file as a base-16 encoded string

Lists all the files in a directory

Functions

hash_pieces(paths, piece_length)
hash_pieces(String.t | [String.t], non_neg_integer) :: <<_::_*20>>

Encodes the sha1 hash for the parts of a file or list of files in a single binary.

md5_stream(path)
md5_stream(String.t) :: String.t

Calculates the md5 of a file as a base-16 encoded string.

traverse_dir(directory, timeout \\ 30000)
traverse_dir(String.t, integer) :: [String.t]

Lists all the files in a directory.