sha1
Calculate SHA-1 cryptographic hash values for text strings to verify data integrity and generate unique identifiers.
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)The inline handler function that executes the sha1 tool logic by calling DigestUtil.sha1 and returning the hash as text content.({ input }) => { const hash = DigestUtil.sha1(input); return { content: [{ type: "text", text: hash }], }; }
- src/service/digest.ts:90-92 (schema)The input schema for the sha1 tool, validating input as a string using Zod.{ input: z.string().describe("The input string to hash"), },
- src/service/digest.ts:87-98 (registration)Registration of the sha1 tool on the MCP server, including name, description, schema, and handler.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)Helper utility function 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(); }