Skip to main content
Glama

sha256

Generate SHA-256 hash values for input strings to ensure data integrity and secure processing within the Crypto_MCP server's encryption framework.

Instructions

Calculate SHA-256 hash of a string

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
inputYesThe input string to hash

Implementation Reference

  • Inline handler function for the sha256 tool that calls the DigestUtil.sha256 helper and returns the hash as text content in MCP format.
    ({ input }) => { const hash = DigestUtil.sha256(input); return { content: [{ type: "text", text: hash }], }; }
  • Zod input schema defining a single string parameter for the input to hash.
    { input: z.string().describe("The input string to hash"), },
  • Registration of the sha256 tool on the McpServer, including name, description, schema, and handler.
    server.tool( "sha256", "Calculate SHA-256 hash of a string", { input: z.string().describe("The input string to hash"), }, ({ input }) => { const hash = DigestUtil.sha256(input); return { content: [{ type: "text", text: hash }], }; } );
  • DigestUtil static method implementing the SHA-256 hash computation using CryptoJS.SHA256.
    static sha256(input: string): string { const hash = CryptoJS.SHA256(input); return hash.toString(); }

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