Skip to content

Commit

Permalink
Merge pull request #15 from achambers/remove-broccoli-asset-rev-deps
Browse files Browse the repository at this point in the history
Remove dependency on broccoli-asset-rev
  • Loading branch information
lukemelia committed Aug 27, 2015
2 parents 3ebb0e6 + c87110f commit 699472f
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions lib/key-generators/file-hash.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ var CoreObject = require('core-object');
var fs = require('fs');
var path = require('path');
var minimatch = require('minimatch');
var Fingerprint = require('broccoli-asset-rev/lib/fingerprint');
var crypto = require('crypto');
var Promise = require('ember-cli/lib/ext/promise');

var denodeify = require('rsvp').denodeify;
Expand All @@ -29,8 +29,7 @@ module.exports = CoreObject.extend({

return readFile(filePath)
.then(function(contents) {
fingerprint = new Fingerprint();
return fingerprint.hashFn(contents.toString());
return md5Hash(contents.toString());
})
},

Expand All @@ -42,3 +41,9 @@ module.exports = CoreObject.extend({
return config[key];
}
});

function md5Hash(buf) {
var md5 = crypto.createHash('md5');
md5.update(buf);
return md5.digest('hex');
}

0 comments on commit 699472f

Please sign in to comment.