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
| Name | Required | Description | Default |
|---|---|---|---|
| input | Yes | The input string to hash |
Implementation Reference
- src/service/digest.ts:137-142 (handler)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 }], }; }
- src/service/digest.ts:134-136 (schema)Input schema for the sha512 tool using Zod: a single string parameter.{ input: z.string().describe("The input string to hash"), },
- src/service/digest.ts:131-143 (registration)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 }], }; } );
- src/service/digest.ts:51-54 (helper)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(); }