var crypto = require('crypto'),
    fs = require('fs'),
    Promise = require('core-js/library/es6/promise'),
    // change the algo to sha1, sha256 etc according to your requirements
    algo = 'md5';

module.exports = function fileHash(path) {
    var shasum = crypto.createHash(algo),
        stream = fs.ReadStream(path);
    return new Promise(function calcHash(reject, resolve) {
        stream.on('error', reject)
              .on('data', function(d) { shasum.update(d); })
              .on('end', function digest() {
            var d = shasum.digest('hex');
            resolve(d);
        });
    });
}

@@ -366,21 +366,21 @@
 h(re
-ject, resolve
+solve, reject
 ) %7B%0A

swap reject and resolve in promise