lib/rsync/rsync-utils.js
function getChecksum(fs, path, callback) {
  fs.readFile(path, function(err, data) {
    if(!err) {
      callback(null, md5sum(data));
    } else if(err.code === 'ENOENT') {
      // File does not exist so the checksum is an empty string
      callback(null, "");
    } else {
      callback(err);
    }
  });
}
function getChecksum(fs, path, callback) {
  fs.readFile(path, function(err, data) {
    if(!err) {
      callback(null, md5sum(data));
    } else if(err.code === 'ENOENT') {
      // File does not exist so the checksum is an empty string
      callback(null, "");
    } else {
      callback(err);
    }
  });
}
function getChecksum ( fs , path , callback ) { fs . readFile ( path , function ( err , data ) { if ( ! err ) { callback ( null , md5sum ( data ) ) ; } else if ( err . code === 'ENOENT' ) { // File does not exist so the checksum is an empty string callback ( null , "" ) ; } else { callback ( err ) ; } } ) ; }
Generate the MD5 hash for the data of a file in its entirety
Generate the MD5 hash for the data of a file in its entirety