'Compute MD5 hash of file.'

def file_md5(self, file_name):

    with open(file_name, u'rb') as f:
        file_contents = f.read()
        file_hash = hashlib.md5(file_contents).hexdigest()
    return file_hash
