Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

rev-hash

3.0.0 • Public • Published

rev-hash Build Status

Create a hash for file revving

It will create an md5 hash from an input buffer or string, and truncate 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.

Install

$ npm install rev-hash

Usage

const fs = require('fs');
const revisionHash = require('rev-hash');
 
revisionHash(fs.readFileSync('unicorn.png'));
//=> 'bb9d8fe615'
 
revisionHash('Lorem ipsum dolor sit amet');
//=> 'fea80f2db0'

API

revisionHash(input)

input

Type: Buffer | string

Data to create a hash from.

License

MIT © Sindre Sorhus

Install

npm i rev-hash

DownloadsWeekly Downloads

101,639

Version

3.0.0

License

MIT

Unpacked Size

3.32 kB

Total Files

5

Last publish

Collaborators

  • avatar