Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

rev-hash

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rev-hash

Create a hash for file revving

  • 3.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
123K
decreased by-1.56%
Maintainers
1
Weekly downloads
 
Created

What is rev-hash?

The rev-hash npm package is used to generate a hash from a file or string content. This is particularly useful for cache busting in web development, where you need to ensure that users get the latest version of a file.

What are rev-hash's main functionalities?

Generate hash from file content

This feature allows you to generate a hash from the content of a file. You read the file into a buffer and then pass that buffer to the rev-hash function to get the hash.

const revHash = require('rev-hash');
const fs = require('fs');

const buffer = fs.readFileSync('path/to/file');
const hash = revHash(buffer);
console.log(hash);

Generate hash from string content

This feature allows you to generate a hash from a string. You simply pass the string to the rev-hash function to get the hash.

const revHash = require('rev-hash');

const content = 'Hello, world!';
const hash = revHash(content);
console.log(hash);

Other packages similar to rev-hash

Keywords

FAQs

Package last updated on 26 Apr 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc