# Path: crowdastro/import_data.py
# def hash_file(f):
#     """Finds the MD5 hash of a file.
# 
#     File must be opened in bytes mode.
#     """
#     h = hashlib.md5()
#     chunk_size = 65536  # 64 KiB
#     for chunk in iter(lambda: f.read(chunk_size), b''):
#         h.update(chunk)
#     return h.hexdigest()


import argparse
import csv
import io
from crowdastro.import_data import hash_file
"""Compute checksums for a list of files.

Matthew Alger
The Australian National University
2016
"""




def main():
    parser = argparse.ArgumentParser()
    parser.add_argument('filenames', nargs='+')

    args = parser.parse_args()

    out = io.StringIO()
    writer = csv.writer(out)

    for filename in args.filenames:
        with open(filename, 'rb') as f:

# Path: crowdastro/import_data.py
# def hash_file(f):
#     """Finds the MD5 hash of a file.
# 
#     File must be opened in bytes mode.
#     """
#     h = hashlib.md5()
#     chunk_size = 65536  # 64 KiB
#     for chunk in iter(lambda: f.read(chunk_size), b''):
#         h.update(chunk)
#     return h.hexdigest()


# Path: crowdastro/checksums.py
import argparse
import csv
import io
from crowdastro.import_data import hash_file

"""Compute checksums for a list of files.

Matthew Alger
The Australian National University
2016
"""




def main():
    parser = argparse.ArgumentParser()
    parser.add_argument('filenames', nargs='+')

    args = parser.parse_args()

    out = io.StringIO()
    writer = csv.writer(out)

    for filename in args.filenames:
        with open(filename, 'rb') as f:

            h = hash_file(f)