sha1
Generate a SHA-1 hash from any input string to verify data integrity or produce a fixed-length digest for cryptographic operations.
Instructions
Calculate SHA-1 hash of a string
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| input | Yes | The input string to hash |
Implementation Reference
- src/service/digest.ts:21-24 (handler)The DigestUtil.sha1() static method that computes the SHA-1 hash using CryptoJS.SHA1().
static sha1(input: string): string { const hash = CryptoJS.SHA1(input); return hash.toString(); } - src/service/digest.ts:90-91 (schema)Input schema for the sha1 tool: a single string parameter 'input' described as 'The input string to hash'.
{ input: z.string().describe("The input string to hash"), - src/service/digest.ts:86-99 (registration)Registration of 'sha1' tool via server.tool() with name, description, input schema, and handler callback.
// Register SHA-1 tool 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/index.ts:16-16 (registration)Top-level call to registerDigestTool(server) which registers the sha1 tool among other digest tools.
registerDigestTool(server);