rev-hash

WebJar for rev-hash

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

rev-hash
Last Version

Last Version

2.0.0
Release Date

Release Date

Type

Type

jar
Description

Description

rev-hash
WebJar for rev-hash
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/sindresorhus/rev-hash

Download rev-hash

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/rev-hash/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>rev-hash</artifactId>
    <version>2.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/rev-hash/
implementation 'org.webjars.npm:rev-hash:2.0.0'
// https://jarcasting.com/artifacts/org.webjars.npm/rev-hash/
implementation ("org.webjars.npm:rev-hash:2.0.0")
'org.webjars.npm:rev-hash:jar:2.0.0'
<dependency org="org.webjars.npm" name="rev-hash" rev="2.0.0">
  <artifact name="rev-hash" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='rev-hash', version='2.0.0')
)
libraryDependencies += "org.webjars.npm" % "rev-hash" % "2.0.0"
[org.webjars.npm/rev-hash "2.0.0"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

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.

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.

Versions

Version
2.0.0