Create a hashed file name
JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
test
.editorconfig
.gitattributes
.gitignore
.travis.yml
index.js
license
package.json
readme.md

readme.md

hash-file Build Status

Create a hashed file name

Install

$ npm install --save hash-file

Usage

const hashFile = require('hash-file');

hashFile('test.jpg').then(hash => {
    console.log(hash);
    //=> 'ac8b2c4b75b2d36988c62b919a857f1baacfcd4c'
});

hashFile.sync('test.jpg');
//=> 'ac8b2c4b75b2d36988c62b919a857f1baacfcd4c'

License

MIT © Kevin Mårtensson