Skip to main content
Glama

sha512

Calculate SHA-512 hash values for text strings to verify data integrity and authenticate digital information using this cryptographic hashing function.

Instructions

Calculate SHA-512 hash of a string

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
inputYesThe input string to hash

Implementation Reference

  • MCP tool handler for 'sha512' that invokes DigestUtil.sha512 on the input and returns the hexadecimal hash as text content.
    ({ input }) => {
      const hash = DigestUtil.sha512(input);
      return {
        content: [{ type: "text", text: hash }],
      };
    }
  • Input schema for the sha512 tool using Zod: a single string parameter.
    {
      input: z.string().describe("The input string to hash"),
    },
  • Registration of the 'sha512' tool on the McpServer instance, including name, description, schema, and handler function.
    server.tool(
      "sha512",
      "Calculate SHA-512 hash of a string",
      {
        input: z.string().describe("The input string to hash"),
      },
      ({ input }) => {
        const hash = DigestUtil.sha512(input);
        return {
          content: [{ type: "text", text: hash }],
        };
      }
    );
  • Utility function DigestUtil.sha512 that computes the SHA-512 hash of the input string using CryptoJS and returns the hexadecimal string.
    static sha512(input: string): string {
      const hash = CryptoJS.SHA512(input);
      return hash.toString();
    }

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