This commit is contained in:
Tutur33
2023-11-24 22:35:41 +01:00
parent 3c0b507a93
commit 7644b2a0f7
45165 changed files with 4803356 additions and 3 deletions
+44
View File
@@ -0,0 +1,44 @@
# rev-hash [![Build Status](https://travis-ci.org/sindresorhus/rev-hash.svg?branch=master)](https://travis-ci.org/sindresorhus/rev-hash)
> 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](http://blog.risingstack.com/automatic-cache-busting-for-your-css/).
## Install
```
$ npm install rev-hash
```
## Usage
```js
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](https://sindresorhus.com)