Calculate the md5sum of a file.

def md5sum(filen):
    '''Calculate the md5sum of a file.
    '''
    with open(filen, 'rb') as fileh:
        md5 = hashlib.md5(fileh.read())

    return md5.hexdigest()