Socket
Socket
Sign inDemoInstall

rev-hash

Package Overview
Dependencies
0
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    rev-hash

Create a hash for file revving


Version published
Weekly downloads
121K
decreased by-6.93%
Maintainers
1
Install size
3.22 kB
Created
Weekly downloads
 

Readme

Source

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

import fs from 'node:fs';
import revisionHash from 'rev-hash';

revisionHash(fs.readFileSync('unicorn.png'));
//=> 'bb9d8fe615'

revisionHash('Lorem ipsum dolor sit amet');
//=> 'fea80f2db0'

API

revisionHash(input)

input

Type: Uint8Array | string

The data to create a hash from.

Keywords

FAQs

Last updated on 01 Nov 2023

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc