npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@toolsnap/hash-generator-tool

v1.0.0

Published

A universal hash generator supporting MD5, SHA1, SHA256, SHA512 and more for strings, files, and buffers

Downloads

74

Readme

@toolsnap/hash-generator-tool

A universal hash generator supporting MD5, SHA1, SHA256, SHA512, and more — for strings, files, and buffers.

Features

  • Multiple Algorithms — MD5, SHA1, SHA256, SHA384, SHA512
  • String Hashing — Generate hashes from any string or text input
  • File Hashing — Compute checksums for files on disk
  • Buffer Support — Hash raw binary data directly
  • Streaming — Hash large files efficiently with streaming API
  • HMAC Support — Generate HMAC signatures with a secret key
  • Built on Node.js Crypto — Native performance, no external dependencies

Installation

npm install @toolsnap/hash-generator-tool

Usage

Hash a String

const { hash } = require('@toolsnap/hash-generator-tool');

// SHA-256 (default)
console.log(hash('hello world'));
// b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9

// Specify algorithm
console.log(hash('hello world', 'md5'));
// 5eb63bbbe01eeed093cb22bb8f5acdc3

console.log(hash('hello world', 'sha1'));
// 2aae6c35c94fcfb415dbe95f408b9ce91ee846ed

Hash a File

const { hashFile } = require('@toolsnap/hash-generator-tool');

async function checksum() {
  const sha256 = await hashFile('./package.json', 'sha256');
  console.log(sha256);
}

HMAC Signature

const { hmac } = require('@toolsnap/hash-generator-tool');

console.log(hmac('hello world', 'my-secret-key', 'sha256'));
// e.g. a3f2b8c1d4e5...

Supported Algorithms

| Algorithm | Output Length | Use Case | |-----------|-------------|----------| | MD5 | 32 hex chars | Legacy checksums, non-security | | SHA1 | 40 hex chars | Git commits, legacy signatures | | SHA256 | 64 hex chars | General purpose, recommended default | | SHA384 | 96 hex chars | Higher security requirements | | SHA512 | 128 hex chars | Maximum security, large data |

Use Cases

  • File Integrity Verification — Generate and compare checksums to verify file integrity after download or transfer
  • Password Hashing — Store password hashes instead of plaintext (use with salt for production)
  • API Authentication — Sign API requests with HMAC for secure communication
  • Data Deduplication — Identify duplicate content by comparing hash values
  • Change Detection — Monitor file changes by tracking hash differences

Best Practices

  1. Use SHA-256 or higher for security-sensitive applications — MD5 and SHA1 have known collision vulnerabilities
  2. Always use HMAC with a secret key for API signatures — Plain hashes can be forged
  3. Salt passwords before hashing — Add random data to prevent rainbow table attacks
  4. Verify file hashes after downloads — Ensure downloaded files haven't been tampered with
  5. Choose algorithm based on threat model — SHA512 for high-security, SHA256 for general use

License

MIT


Try our free online tools at RiseTop