Create a hash for file revving
It will create a
md5 hash from the input buffer and slice it to 10 characters, which is unique enough for this purpose. If you think you need a different hash algorithm or a longer hash, you're wrong.
$ npm install --save rev-hash
var fs = require('fs');var revHash = require('rev-hash');var buffer = fs.readFileSync('unicorn.png');revHash(buffer);//=> 'bb9d8fe615'
MIT © Sindre Sorhus