{
  "openapi": "3.0.3",
  "info": {
    "title": "Crypto & Encoding Toolkit",
    "description": "Hashing (MD5/SHA-1/256/512), HMAC, Base64 encode/decode, UUID v4, secure password generator, and JWT decoder.",
    "version": "1.0.0"
  },
  "components": {
    "schemas": {}
  },
  "paths": {
    "/hash": {
      "get": {
        "summary": "Compute hash",
        "tags": [
          "Crypto"
        ],
        "description": "Returns the hash of the provided text.",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "maxLength": 100000
            },
            "example": "hello",
            "in": "query",
            "name": "text",
            "required": true
          },
          {
            "schema": {
              "type": "string",
              "enum": [
                "md5",
                "sha1",
                "sha256",
                "sha512"
              ],
              "default": "sha256"
            },
            "example": "sha256",
            "in": "query",
            "name": "algo",
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "algo": {
                      "type": "string"
                    },
                    "hash": {
                      "type": "string"
                    },
                    "hex": {
                      "type": "string"
                    },
                    "length": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Bad request",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/hmac": {
      "post": {
        "summary": "Compute HMAC",
        "tags": [
          "Crypto"
        ],
        "description": "Returns the HMAC of the provided text and key.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "text",
                  "key"
                ],
                "properties": {
                  "text": {
                    "type": "string",
                    "maxLength": 100000,
                    "example": "hello"
                  },
                  "key": {
                    "type": "string",
                    "maxLength": 100000,
                    "example": "secret"
                  },
                  "algo": {
                    "type": "string",
                    "enum": [
                      "md5",
                      "sha1",
                      "sha256",
                      "sha512"
                    ],
                    "default": "sha256",
                    "example": "sha256"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "algo": {
                      "type": "string"
                    },
                    "hmac": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Bad request",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/base64/encode": {
      "get": {
        "summary": "Base64 encode",
        "tags": [
          "Crypto"
        ],
        "description": "Encodes text to Base64.",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "maxLength": 100000
            },
            "example": "hello",
            "in": "query",
            "name": "text",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "input": {
                      "type": "string"
                    },
                    "base64": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Bad request",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/base64/decode": {
      "get": {
        "summary": "Base64 decode",
        "tags": [
          "Crypto"
        ],
        "description": "Decodes Base64 to text.",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "maxLength": 100000
            },
            "example": "aGVsbG8=",
            "in": "query",
            "name": "data",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "input": {
                      "type": "string"
                    },
                    "decoded": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Bad request",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/uuid": {
      "get": {
        "summary": "Generate UUIDs",
        "tags": [
          "Crypto"
        ],
        "description": "Returns one or more random UUIDs.",
        "parameters": [
          {
            "schema": {
              "type": "integer",
              "default": 1,
              "minimum": 1,
              "maximum": 100
            },
            "example": 3,
            "in": "query",
            "name": "count",
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "count": {
                      "type": "integer"
                    },
                    "uuids": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Bad request",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/password": {
      "get": {
        "summary": "Generate password",
        "tags": [
          "Crypto"
        ],
        "description": "Generates a random password with configurable character sets.",
        "parameters": [
          {
            "schema": {
              "type": "integer",
              "default": 16,
              "minimum": 8,
              "maximum": 128
            },
            "example": 12,
            "in": "query",
            "name": "length",
            "required": false
          },
          {
            "schema": {
              "type": "string",
              "default": "true"
            },
            "example": "false",
            "in": "query",
            "name": "numbers",
            "required": false
          },
          {
            "schema": {
              "type": "string",
              "default": "true"
            },
            "example": "true",
            "in": "query",
            "name": "symbols",
            "required": false
          },
          {
            "schema": {
              "type": "string",
              "default": "true"
            },
            "example": "true",
            "in": "query",
            "name": "uppercase",
            "required": false
          },
          {
            "schema": {
              "type": "string",
              "default": "true"
            },
            "example": "true",
            "in": "query",
            "name": "lowercase",
            "required": false
          }
        ],
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "password": {
                      "type": "string"
                    },
                    "length": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Bad request",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/jwt/decode": {
      "post": {
        "summary": "Decode JWT",
        "tags": [
          "Crypto"
        ],
        "description": "Decodes a JWT without verifying its signature.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "token"
                ],
                "properties": {
                  "token": {
                    "type": "string",
                    "example": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIn0.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Default Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "header": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "payload": {
                      "type": "object",
                      "additionalProperties": true
                    },
                    "signature": {
                      "type": "string"
                    },
                    "note": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request",
            "content": {
              "application/json": {
                "schema": {
                  "description": "Bad request",
                  "type": "object",
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "servers": [
    {
      "url": "https://web-toolbox-api-production.up.railway.app/crypto",
      "description": "Production"
    }
  ]
}