Nested Parenthetical Madness
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

rev-hash

2.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 revHash = require('rev-hash');
 
revHash(fs.readFileSync('unicorn.png'));
//=> 'bb9d8fe615'
 
revHash('Lorem ipsum dolor sit amet');
//=> 'fea80f2db0'

API

revHash(input)

input

Type: Buffer string

Data to create a hash from.

License

MIT © Sindre Sorhus

install

npm i rev-hash

Downloadsweekly downloads

82,465

version

2.0.0

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar