文本哈希
计算文本的哈希摘要。支持 MD5、SHA-1、SHA-2 系列、SHA-3 系列、ripemd160、blake2。可一次输出全部算法便于比对。**单向不可逆**,不可用于密码存储。
gongdana.crypto.hash
待哈希文本
哈希算法
是否一次输出全部算法的结果
输出格式
结果
填写左侧参数后点击「计算」
公式护照
hash = H(message),H 为所选算法
适用边界与免责
- MD5 与 SHA-1 已被证明存在碰撞,不再适用于安全场景。
参数说明
共 4 个参数,其中 1 个必填。表格由工具的 JSON Schema 自动生成。
| 参数 | 类型 | 必填 | 约束 | 说明 |
|---|---|---|---|---|
| text | 字符串 | 必填 | — | 待哈希文本 |
| algorithm | 字符串 | 选填 | 可选值:md5 / sha1 / sha224 / sha256 / sha384 / sha512 / sha3-224 / sha3-256 / sha3-384 / sha3-512 / ripemd160 / blake2b512 / blake2s256;默认 "sha256" | 哈希算法 |
| allAlgorithms | 布尔 | 选填 | 默认 false | 是否一次输出全部算法的结果 |
| outputFormat | 字符串 | 选填 | 可选值:hex / Base64(base64) / base64url;默认 "hex" | 输出格式 |
返回字段
hash字符串(必有)哈希值(当 allAlgorithms=false)algorithm字符串(必有)all对象全部算法结果(当 allAlgorithms=true)byteLength整数
API 调用方式
示例使用默认值与首个枚举值,可直接运行
REST
curl -X POST {ORIGIN}/api/call \
-H "Content-Type: application/json" \
-d '{"tool":"gongdana.crypto.hash","input":{"text":"hello","algorithm":"sha256","allAlgorithms":false,"outputFormat":"hex"}}'MCP(JSON-RPC)
端点 {ORIGIN}/mcp;需先完成 initialize 握手。
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "gongdana.crypto.hash",
"arguments": {
"text": "hello",
"algorithm": "sha256",
"allAlgorithms": false,
"outputFormat": "hex"
}
}
}常见问题
文本哈希是做什么的?
计算文本的哈希摘要。支持 MD5、SHA-1、SHA-2 系列、SHA-3 系列、ripemd160、blake2。可一次输出全部算法便于比对。**单向不可逆**,不可用于密码存储。 它属于「加密哈希」分类,工具标识为 gongdana.crypto.hash。
文本哈希需要哪些参数?
必填参数 1 个:text(字符串)。另有选填参数 3 个:algorithm、allAlgorithms、outputFormat。
文本哈希的计算公式是什么?
计算口径为:hash = H(message),H 为所选算法
文本哈希返回什么结果?
返回 JSON 对象,主要字段:hash(字符串(必有) — 哈希值(当 allAlgorithms=false));algorithm(字符串(必有));all(对象 — 全部算法结果(当 allAlgorithms=true));byteLength(整数)。
使用文本哈希要注意什么?
MD5 与 SHA-1 已被证明存在碰撞,不再适用于安全场景。
如何通过 API 调用文本哈希?
REST 方式:POST /api/call,请求体为 {"tool":"gongdana.crypto.hash","input":{...}}。MCP 方式:连接站点根路径下的 /mcp 后调用 tools/call,name 传 "gongdana.crypto.hash"。也可用批量(POST /api/batch)与链式(POST /api/chain)编排多个工具。
文本哈希的结果可以复现吗?
可以。该工具是纯函数,同样的输入永远得到同样的输出,不依赖时间、随机数或外部状态,因此结果可被交叉核对。
相关工具 · 加密哈希
查看全部 22 个 →HMAC 签名gongdana.crypto.hmac常量时间字符串比较gongdana.crypto.constant_time_compareUUID 生成gongdana.crypto.uuid_generateULID 生成gongdana.crypto.ulid_generate安全随机数gongdana.crypto.random_bytes密码强度评估gongdana.crypto.password_strength答案块生成gongdana.geo.answer_blockAI 摘要与元信息生成gongdana.geo.ai_summary图纸解析摘要gongdana.cad.drawing_summary