{"_id":"rev-hash","_rev":"4081096","name":"rev-hash","description":"Create a hash for file revving","dist-tags":{"latest":"4.1.0"},"maintainers":[{"name":"sindresorhus","email":""}],"time":{"modified":"2025-10-28T01:30:01.000Z","created":"2015-05-22T15:42:42.493Z","4.1.0":"2023-11-01T08:45:47.681Z","4.0.0":"2021-11-10T16:52:38.332Z","3.0.0":"2019-04-26T06:48:30.133Z","2.0.0":"2017-06-23T12:49:42.626Z","1.0.0":"2015-05-22T15:42:42.493Z"},"users":{},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"repository":{"type":"git","url":"git+https://github.com/sindresorhus/rev-hash.git"},"versions":{"4.1.0":{"name":"rev-hash","version":"4.1.0","description":"Create a hash for file revving","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/rev-hash.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":"./index.js","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"scripts":{"//test":"xo && ava && tsd","test":"ava && tsd"},"keywords":["hash","crypto","md5","rev","revving","web","buffer","string","file","cache","caching"],"devDependencies":{"@types/node":"^16.11.7","ava":"^3.15.0","tsd":"^0.18.0","xo":"^0.46.4"},"types":"./index.d.ts","gitHead":"30fea693aa12a68b37181149a482097970e714ab","bugs":{"url":"https://github.com/sindresorhus/rev-hash/issues"},"homepage":"https://github.com/sindresorhus/rev-hash#readme","_id":"rev-hash@4.1.0","_nodeVersion":"18.18.2","_npmVersion":"9.2.0","dist":{"shasum":"fc69c6db9e1276dc0bb693a492f27e9c23931c5b","size":1831,"noattachment":false,"key":"/rev-hash/-/rev-hash-4.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/rev-hash/download/rev-hash-4.1.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/rev-hash_4.1.0_1698828347509_0.40289216522488713"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2023-11-01T08:45:47.681Z","publish_time":1698828347681,"_source_registry_name":"default","_cnpm_publish_time":1698828347681},"4.0.0":{"name":"rev-hash","version":"4.0.0","description":"Create a hash for file revving","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/rev-hash.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":"./index.js","engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"scripts":{"test":"xo && ava && tsd"},"keywords":["hash","crypto","md5","rev","revving","web","buffer","string","file","cache","caching"],"devDependencies":{"@types/node":"^16.11.7","ava":"^3.15.0","tsd":"^0.18.0","xo":"^0.46.4"},"types":"./index.d.ts","gitHead":"ffb270df0b319c51da42bea70bae649b0e956e23","bugs":{"url":"https://github.com/sindresorhus/rev-hash/issues"},"homepage":"https://github.com/sindresorhus/rev-hash#readme","_id":"rev-hash@4.0.0","_nodeVersion":"12.22.1","_npmVersion":"8.1.0","dist":{"shasum":"0ae8454d76c26b074abbd0aec741d72dec3323a1","size":1821,"noattachment":false,"key":"/rev-hash/-/rev-hash-4.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/rev-hash/download/rev-hash-4.0.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/rev-hash_4.0.0_1636563158176_0.1318643990244719"},"_hasShrinkwrap":false,"publish_time":1636563158332,"_cnpm_publish_time":1636563158332,"_cnpmcore_publish_time":"2021-12-16T20:26:26.680Z"},"3.0.0":{"name":"rev-hash","version":"3.0.0","description":"Create a hash for file revving","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/rev-hash.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=8"},"scripts":{"test":"xo && ava && tsd"},"keywords":["hash","crypto","md5","rev","revving","web","buffer","string","file","cache","caching"],"devDependencies":{"@types/node":"^11.13.7","ava":"^1.4.1","tsd":"^0.7.2","xo":"^0.24.0"},"gitHead":"05069f85d9c797220a65cc50208b78ce5db0af30","bugs":{"url":"https://github.com/sindresorhus/rev-hash/issues"},"homepage":"https://github.com/sindresorhus/rev-hash#readme","_id":"rev-hash@3.0.0","_nodeVersion":"10.15.3","_npmVersion":"6.9.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"951d73d02b9606ea4bbb7ee3d93c252cd8556ce5","size":1883,"noattachment":false,"key":"/rev-hash/-/rev-hash-3.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/rev-hash/download/rev-hash-3.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/rev-hash_3.0.0_1556261310003_0.71397314971106"},"_hasShrinkwrap":false,"publish_time":1556261310133,"_cnpm_publish_time":1556261310133,"_cnpmcore_publish_time":"2021-12-16T20:26:26.872Z"},"2.0.0":{"name":"rev-hash","version":"2.0.0","description":"Create a hash for file revving","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/rev-hash.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=4"},"scripts":{"test":"xo && ava"},"files":["index.js"],"keywords":["hash","crypto","md5","rev","revving","web","buffer","string","file","cache","caching"],"devDependencies":{"ava":"*","xo":"*"},"gitHead":"3074712f01305f4ae06076cb7b634376a12c87af","bugs":{"url":"https://github.com/sindresorhus/rev-hash/issues"},"homepage":"https://github.com/sindresorhus/rev-hash#readme","_id":"rev-hash@2.0.0","_shasum":"7720a236ed0c258df3e64bec03ec048b05b924c4","_from":".","_npmVersion":"2.15.11","_nodeVersion":"4.8.3","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"7720a236ed0c258df3e64bec03ec048b05b924c4","size":1742,"noattachment":false,"key":"/rev-hash/-/rev-hash-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/rev-hash/download/rev-hash-2.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/rev-hash-2.0.0.tgz_1498222181704_0.42197213461622596"},"directories":{},"publish_time":1498222182626,"_hasShrinkwrap":false,"_cnpm_publish_time":1498222182626,"_cnpmcore_publish_time":"2021-12-16T20:26:27.062Z"},"1.0.0":{"name":"rev-hash","version":"1.0.0","description":"Create a hash for file revving","license":"MIT","repository":{"type":"git","url":"https://github.com/sindresorhus/rev-hash"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=0.10.0"},"scripts":{"test":"node test.js"},"files":["index.js"],"keywords":["hash","crypto","md5","rev","revving","web","buffer","file","cache","caching"],"devDependencies":{"ava":"0.0.4"},"gitHead":"6a9e4a83dec51c82964e9117949b8eb504ed25c1","bugs":{"url":"https://github.com/sindresorhus/rev-hash/issues"},"homepage":"https://github.com/sindresorhus/rev-hash","_id":"rev-hash@1.0.0","_shasum":"96993959ea9bfb1c59b13adf02ac2e34bb373603","_from":".","_npmVersion":"2.9.1","_nodeVersion":"0.12.3","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"96993959ea9bfb1c59b13adf02ac2e34bb373603","size":1666,"noattachment":false,"key":"/rev-hash/-/rev-hash-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/rev-hash/download/rev-hash-1.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"publish_time":1432309362493,"_hasShrinkwrap":false,"_cnpm_publish_time":1432309362493,"_cnpmcore_publish_time":"2021-12-16T20:26:27.265Z"}},"readme":"# rev-hash\n\n> Create a hash for file revving\n\nIt will create an `md5` hash from an input buffer or string, and truncate it to 10 characters, which is unique enough for this purpose.\n\nIf you think you need a different hash algorithm or a longer hash, [you're wrong](https://blog.risingstack.com/automatic-cache-busting-for-your-css/).\n\n## Install\n\n```sh\nnpm install rev-hash\n```\n\n## Usage\n\n```js\nimport fs from 'node:fs';\nimport revisionHash from 'rev-hash';\n\nrevisionHash(fs.readFileSync('unicorn.png'));\n//=> 'bb9d8fe615'\n\nrevisionHash('Lorem ipsum dolor sit amet');\n//=> 'fea80f2db0'\n```\n\n## API\n\n### revisionHash(input)\n\n#### input\n\nType: `Uint8Array | string`\n\nThe data to create a hash from.\n","_attachments":{},"homepage":"https://github.com/sindresorhus/rev-hash#readme","bugs":{"url":"https://github.com/sindresorhus/rev-hash/issues"},"license":"MIT"}