sha512
Compute SHA-512 hash of an input string for cryptographic verification and data integrity validation.
Instructions
Calculate SHA-512 hash of a string
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| input | Yes | The input string to hash |
Implementation Reference
- src/service/digest.ts:46-54 (handler)DigestUtil.sha512() - The core handler that computes SHA-512 hash using CryptoJS.SHA512() and returns the result as a hex string.
/** * Calculate SHA-512 hash of a string * @param input The input string to hash * @returns 128-character hexadecimal SHA-512 hash */ static sha512(input: string): string { const hash = CryptoJS.SHA512(input); return hash.toString(); } - src/service/digest.ts:130-143 (registration)Registration of the 'sha512' tool on the McpServer, with a Zod schema for input validation and a handler that delegates to DigestUtil.sha512().
// Register SHA-512 tool 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 }], }; } ); - src/service/digest.ts:134-135 (schema)Zod schema defining the 'input' parameter as a required string for the sha512 tool.
{ input: z.string().describe("The input string to hash"), - src/index.ts:16-16 (registration)Top-level registration call that registers the digest tool (including sha512) on the MCP server.
registerDigestTool(server);