md5
Calculate MD5 hash values for strings to verify data integrity or generate checksums for security and validation purposes.
Instructions
Calculate MD5 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:79-84 (handler)The md5 tool handler that computes the MD5 hash of the input string using the DigestUtil helper and returns it as text content.({ input }) => { const hash = DigestUtil.md5(input); return { content: [{ type: "text", text: hash }], }; }
- src/service/digest.ts:76-78 (schema)Zod schema defining the input as a string for the md5 tool.{ input: z.string().describe("The input string to hash"), },
- src/service/digest.ts:73-85 (registration)Registration of the md5 tool on the McpServer.server.tool( "md5", "Calculate MD5 hash of a string", { input: z.string().describe("The input string to hash"), }, ({ input }) => { const hash = DigestUtil.md5(input); return { content: [{ type: "text", text: hash }], }; } );
- src/service/digest.ts:11-14 (helper)DigestUtil.md5 static method that performs the actual MD5 hashing using CryptoJS.static md5(input: string): string { const hash = CryptoJS.MD5(input); return hash.toString(); }