function checkHashMatchMD5(stream, hashedStream, dataRetrievalInfo, log, cb) {
    const contentMD5 = stream.contentMD5;
    const completedHash = hashedStream.completedHash;
    if (contentMD5 && completedHash && contentMD5 !== completedHash) {
        log.debug('contentMD5 and completedHash do not match, deleting data', {
            method: 'storeObject::dataStore',
            completedHash,
            contentMD5,
        });
        const dataToDelete = [];
        dataToDelete.push(dataRetrievalInfo);
        return data.batchDelete(dataToDelete, null, null, log, err => {
            if (err) {
                // failure of batch delete is only logged, client gets the
                // error code about the md mismatch
                log.error('error deleting old data', { error: err });
            }
            return cb(errors.BadDigest);
        });
    }
    return cb(null, dataRetrievalInfo, completedHash);
}
Check that `hashedStream.completedHash` matches header `stream.contentMD5`
and delete old data or remove 'hashed' listeners, if applicable.
@param {object} stream - stream containing the data
@param {object} hashedStream - instance of MD5Sum
@param {object} dataRetrievalInfo - object containing the keys of stored data
@param {number} dataRetrievalInfo.key - key of the stored data
@param {string} dataRetrievalInfo.dataStoreName - the implName of the data
@param {object} log - request logger instance
@param {function} cb - callback to send error or move to next task
@return {function} - calls callback with arguments:
error, dataRetrievalInfo, and completedHash (if any)