lib/util.js
function verifyChecksum(fileName, checksum) {
  return kew.resolve(hasha.fromFile(fileName, {algorithm: 'sha256'})).then(function (hash) {
    var result = checksum == hash
    if (result) {
      console.log('Verified checksum of previously downloaded file')
    } else {
      console.log('Checksum did not match')
    }
    return result
  }).fail(function (err) {
    console.error('Failed to verify checksum: ', err)
    return false
  })
}
function verifyChecksum(fileName, checksum) {
  return kew.resolve(hasha.fromFile(fileName, {algorithm: 'sha256'})).then(function (hash) {
    var result = checksum == hash
    if (result) {
      console.log('Verified checksum of previously downloaded file')
    } else {
      console.log('Checksum did not match')
    }
    return result
  }).fail(function (err) {
    console.error('Failed to verify checksum: ', err)
    return false
  })
}
function verifyChecksum ( fileName , checksum ) { return kew . resolve ( hasha . fromFile ( fileName , { algorithm : 'sha256' } ) ) . then ( function ( hash ) { var result = checksum == hash if ( result ) { console . log ( 'Verified checksum of previously downloaded file' ) } else { console . log ( 'Checksum did not match' ) } return result } ) . fail ( function ( err ) { console . error ( 'Failed to verify checksum: ' , err ) return false } ) }
Check to make sure that the file matches the checksum.
@param {string} fileName
@param {string} checksum
@return {Promise.<boolean>}
Check to make sure that the file matches the checksum .