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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@sylphlab/tools-hasher

v0.7.1

Published

Core logic for MCP hashing tools

Downloads

15

Readme

@sylphlab/tools-hasher

NPM version

Core logic for generating cryptographic hashes.

This package provides the underlying logic and tool definitions for creating hashes of strings or files using common algorithms like MD5, SHA-256, and SHA-512. It's designed using @sylphlab/tools-core and serves as the foundation for @sylphlab/tools-hasher-mcp.

Purpose

Hashing is essential for data integrity checks, checksums, password storage (though salted hashing is preferred for passwords), and various other cryptographic applications. This package offers standardized tools for generating these hashes. By defining them with @sylphlab/tools-core, the logic becomes reusable across different platforms like MCP servers.

Tools Provided

  • hashTool: A versatile tool that takes a string input (or potentially a file path in future versions) and calculates its hash using a specified algorithm.
    • Supports algorithms like md5, sha256, sha512.
    • Returns the calculated hash as a hexadecimal string.

Key Features

  • Multiple Algorithms: Supports common hashing algorithms (MD5, SHA-256, SHA-512).
  • Standardized Definition: Uses the SylphTool structure from @sylphlab/tools-core.
  • Node.js Crypto: Leverages the built-in crypto module in Node.js for reliable hash generation.

Installation

This package is primarily intended for internal use within the mcp monorepo, mainly as a dependency for @sylphlab/tools-hasher-mcp.

# From the root of the monorepo
pnpm add @sylphlab/tools-hasher --filter <your-package-name>

Usage (Conceptual)

The tool definitions are typically consumed by adapters or MCP server implementations.

import { hashTool } from '@sylphlab/tools-hasher';
import { adaptToolToMcp } from '@sylphlab/tools-adaptor-mcp'; // Example adapter

// Example: Using the tool definition directly
async function runHash() {
  const input = { text: 'Hello World', algorithm: 'sha256' };
  // Validate input against hashTool.inputSchema...
  const output = await hashTool.handler(input);
  // Validate output against hashTool.outputSchema...
  if (output.success) {
    console.log(output.hash); // Output: a591a6d40bf420404a011733cfb7b190d62c65bf0bcda32b57b277d9ad9f146e
  }
}

// Example: Adapting for MCP
const mcpHashTool = adaptToolToMcp(hashTool);

// This adapted definition would then be used to create the MCP server.

Dependencies

  • @sylphlab/tools-core: Provides defineTool and core types.
  • zod: For input/output schema definition and validation.

Developed by Sylph Lab.