Skip to main content
Glama

sha1

Generate SHA-1 hash for any input string using this tool from the Crypto_MCP server, ensuring secure and efficient data hashing for enhanced processing and verification.

Instructions

Calculate SHA-1 hash of a string

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
inputYesThe input string to hash

Implementation Reference

  • Handler function for the sha1 tool that invokes DigestUtil.sha1 and formats the result as MCP content.
    ({ input }) => { const hash = DigestUtil.sha1(input); return { content: [{ type: "text", text: hash }], }; }
  • Input schema for the sha1 tool, defining a string input parameter.
    { input: z.string().describe("The input string to hash"), },
  • Registration of the sha1 tool on the MCP server, including name, description, input schema, and handler function.
    server.tool( "sha1", "Calculate SHA-1 hash of a string", { input: z.string().describe("The input string to hash"), }, ({ input }) => { const hash = DigestUtil.sha1(input); return { content: [{ type: "text", text: hash }], }; } );
  • Static utility method in DigestUtil class that computes the SHA-1 hash of the input string using CryptoJS.
    static sha1(input: string): string { const hash = CryptoJS.SHA1(input); return hash.toString(); }
  • src/index.ts:16-16 (registration)
    Invocation of registerDigestTool which registers the sha1 tool (among others) on the main MCP server.
    registerDigestTool(server);

Other Tools

Related Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/1595901624/crypto-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server