sha1
Generate SHA-1 hash for any input string using this tool from the Crypto_MCP server, ensuring secure and efficient data hashing for enhanced processing and verification.
Instructions
Calculate SHA-1 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:93-98 (handler)Handler function for the sha1 tool that invokes DigestUtil.sha1 and formats the result as MCP content.({ input }) => { const hash = DigestUtil.sha1(input); return { content: [{ type: "text", text: hash }], }; }
- src/service/digest.ts:90-92 (schema)Input schema for the sha1 tool, defining a string input parameter.{ input: z.string().describe("The input string to hash"), },
- src/service/digest.ts:87-99 (registration)Registration of the sha1 tool on the MCP server, including name, description, input schema, and handler function.server.tool( "sha1", "Calculate SHA-1 hash of a string", { input: z.string().describe("The input string to hash"), }, ({ input }) => { const hash = DigestUtil.sha1(input); return { content: [{ type: "text", text: hash }], }; } );
- src/service/digest.ts:21-24 (helper)Static utility method in DigestUtil class that computes the SHA-1 hash of the input string using CryptoJS.static sha1(input: string): string { const hash = CryptoJS.SHA1(input); return hash.toString(); }
- src/index.ts:16-16 (registration)Invocation of registerDigestTool which registers the sha1 tool (among others) on the main MCP server.registerDigestTool(server);