Compute a checksum on a given file-like object.
- Parameters:
file (io.IOBase) – File-like object, as returned by open() for example.
method (str) – Checksum to use. Can be any of md5, sha256,
crc32.
The file is read block by block to avoid clogging the memory with a huge
read.