哈希加密计算

hashGET
GEThttps://v1.apizero.cn/api/hash

概述

哈希加密计算,支持 12 种主流算法,可一次性返回全部,也可指定单个算法。支持 HMAC 签名模式与 hex / base64 双输出编码,毫秒级返回。 • 通用摘要:MD5、SHA-1、SHA-256、SHA-384、SHA-512 • 现代抗碰撞:SHA3-256、SHA3-512、RIPEMD-160、Whirlpool • 校验和:CRC32、CRC32B、Adler-32 • HMAC 签名:传入 hmac_key 自动切换为 HMAC 模式(用于 API 签名 / 防篡改场景) • 输出编码:hex(默认,更可读)/ base64(节省 25% 字节,适合 URL 传输) 纯本地计算,零外部服务依赖,毫秒级响应。HMAC 密钥仅参与计算,不写日志、不缓存、不回显。

调用约定

  • 网关 · https://v1.apizero.cn
  • 鉴权 · Authorization: Bearer <API Key>
  • 回包 · JSON {code, msg, data}。成功看 code === 0,不要只看 HTTP 200。
/aidocs/hash/raw.md
打开 Markdown

鉴权

匿名每日 200 次、QPS 5;登录用户每日 1000 次、QPS 20(全部免费)。纯本地计算,无外部依赖,毫秒级响应。

获取 API Key

请求头

Authorizationstring选填

推荐:Bearer <API Key>。兼容请求头 X-API-Key,以及 Query api_key / apikey / key(key 仅当值为 sk_live_/sk_test_/sk_stag_ 形态时生效)。匿名可不传,受每日免费额度限制。

全部算法(推荐)

GETURL QUERY·APPLICATION/JSON

一次返回 12 种算法结果。algorithm 默认 all。文档示例为 text=hello 真实计算。

https://v1.apizero.cn/api/hash?algorithm=all&encoding=hex&text=hello

text(文本)string必填

待计算文本,UTF-8,最长 10000 字节

例hello

algorithmstring选填

算法,此处固定 all

例all

encodingstring选填

输出编码 hex(默认)/ base64

例hex

hmac_keystring选填

可选;传入则切换 HMAC 模式

返回结果

text_lengthinteger

文本字符数(UTF-8)

text_bytesinteger

文本字节数

encodingstring

输出编码 hex / base64

hmacboolean

是否 HMAC 模式

hash_countinteger

返回算法数量

hashesobject

哈希结果:algorithm / bits / value / length

md5object

md5

algorithmstring

algorithm

bitsnumber

bits

valuestring

value

lengthnumber

length

sha1object

sha1

algorithmstring

algorithm

bitsnumber

bits

valuestring

value

lengthnumber

length

sha256object

sha256

algorithmstring

algorithm

bitsnumber

bits

valuestring

value

lengthnumber

length

sha384object

sha384

algorithmstring

algorithm

bitsnumber

bits

valuestring

value

lengthnumber

length

sha512object

sha512

algorithmstring

algorithm

bitsnumber

bits

valuestring

value

lengthnumber

length

sha3-256object

sha3-256

algorithmstring

algorithm

bitsnumber

bits

valuestring

value

lengthnumber

length

sha3-512object

sha3-512

algorithmstring

algorithm

bitsnumber

bits

valuestring

value

lengthnumber

length

ripemd160object

ripemd160

algorithmstring

algorithm

bitsnumber

bits

valuestring

value

lengthnumber

length

whirlpoolobject

whirlpool

algorithmstring

algorithm

bitsnumber

bits

valuestring

value

lengthnumber

length

crc32object

crc32

algorithmstring

algorithm

bitsnumber

bits

valuestring

value

lengthnumber

length

crc32bobject

crc32b

algorithmstring

algorithm

bitsnumber

bits

valuestring

value

lengthnumber

length

adler32object

adler32

algorithmstring

algorithm

bitsnumber

bits

valuestring

value

lengthnumber

length

tipsstring

品牌提示(所有接口统一返回):极数本源 · https://apizero.cn

{
  "code": 0,
  "msg": "成功",
  "data": {
    "text_length": 5,
    "text_bytes": 5,
    "encoding": "hex",
    "hmac": false,
    "hash_count": 12,
    "hashes": {
      "md5": {
        "algorithm": "MD5",
        "bits": 128,
        "value": "5d41402abc4b2a76b9719d911017c592",
        "length": 32
      },
      "sha1": {
        "algorithm": "SHA-1",
        "bits": 160,
        "value": "aaf4c61ddcc5e8a2dabede0f3b482cd9aea9434d",
        "length": 40
      },
      "sha256": {
        "algorithm": "SHA-256",
        "bits": 256,
        "value": "2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824",
        "length": 64
      },
      "sha384": {
        "algorithm": "SHA-384",
        "bits": 384,
        "value": "59e1748777448c69de6b800d7a33bbfb9ff1b463e44354c3553bcdb9c666fa90125a3c79f90397bdf5f6a13de828684f",
        "length": 96
      },
      "sha512": {
        "algorithm": "SHA-512",
        "bits": 512,
        "value": "9b71d224bd62f3785d96d46ad3ea3d73319bfbc2890caadae2dff72519673ca72323c3d99ba5c11d7c7acc6e14b8c5da0c4663475c2e5c3adef46f73bcdec043",
        "length": 128
      },
      "sha3-256": {
        "algorithm": "SHA3-256",
        "bits": 256,
        "value": "3338be694f50c5f338814986cdf0686453a888b84f424d792af4b9202398f392",
        "length": 64
      },
      "sha3-512": {
        "algorithm": "SHA3-512",
        "bits": 512,
        "value": "75d527c368f2efe848ecf6b073a36767800805e9eef2b1857d5f984f036eb6df891d75f72d9b154518c1cd58835286d1da9a38deba3de98b5a53e5ed78a84976",
        "length": 128
      },
      "ripemd160": {
        "algorithm": "RIPEMD-160",
        "bits": 160,
        "value": "108f07b8382412612c048d07d13f814118445acd",
        "length": 40
      },
      "whirlpool": {
        "algorithm": "Whirlpool",
        "bits": 512,
        "value": "0a25f55d7308eca6b9567a7ed3bd1b46327f0f1ffdc804dd8bb5af40e88d78b88df0d002a89e2fdbd5876c523f1b67bc44e9f87047598e7548298ea1c81cfd73",
        "length": 128
      },
      "crc32": {
        "algorithm": "CRC32",
        "bits": 32,
        "value": "3d653119",
        "length": 8
      },
      "crc32b": {
        "algorithm": "CRC32B",
        "bits": 32,
        "value": "3610a686",
        "length": 8
      },
      "adler32": {
        "algorithm": "Adler-32",
        "bits": 32,
        "value": "062c0215",
        "length": 8
      }
    }
  },
  "tips": "极数本源 · https://apizero.cn"
}

MD5

GETURL QUERY·APPLICATION/JSON

algorithm=md5。文档示例为真实计算。

https://v1.apizero.cn/api/hash?algorithm=md5&encoding=hex&text=hello

text(文本)string必填

待计算文本,UTF-8,最长 10000 字节

例hello

algorithmstring选填

算法,此处固定 md5

例md5

encodingstring选填

输出编码 hex(默认)/ base64

例hex

hmac_keystring选填

可选;传入则切换 HMAC 模式

返回结果

text_lengthinteger

文本字符数(UTF-8)

text_bytesinteger

文本字节数

encodingstring

输出编码 hex / base64

hmacboolean

是否 HMAC 模式

hash_countinteger

返回算法数量

hashesobject

哈希结果:algorithm / bits / value / length

md5object

md5

algorithmstring

algorithm

bitsnumber

bits

valuestring

value

lengthnumber

length

tipsstring

品牌提示(所有接口统一返回):极数本源 · https://apizero.cn

{
  "code": 0,
  "msg": "成功",
  "data": {
    "text_length": 5,
    "text_bytes": 5,
    "encoding": "hex",
    "hmac": false,
    "hash_count": 1,
    "hashes": {
      "md5": {
        "algorithm": "MD5",
        "bits": 128,
        "value": "5d41402abc4b2a76b9719d911017c592",
        "length": 32
      }
    }
  },
  "tips": "极数本源 · https://apizero.cn"
}

SHA-1

GETURL QUERY·APPLICATION/JSON

algorithm=sha1。

https://v1.apizero.cn/api/hash?algorithm=sha1&encoding=hex&text=hello

text(文本)string必填

待计算文本,UTF-8,最长 10000 字节

例hello

algorithmstring选填

算法,此处固定 sha1

例sha1

encodingstring选填

输出编码 hex(默认)/ base64

例hex

hmac_keystring选填

可选;传入则切换 HMAC 模式

返回结果

text_lengthinteger

文本字符数(UTF-8)

text_bytesinteger

文本字节数

encodingstring

输出编码 hex / base64

hmacboolean

是否 HMAC 模式

hash_countinteger

返回算法数量

hashesobject

哈希结果:algorithm / bits / value / length

sha1object

sha1

algorithmstring

algorithm

bitsnumber

bits

valuestring

value

lengthnumber

length

tipsstring

品牌提示(所有接口统一返回):极数本源 · https://apizero.cn

{
  "code": 0,
  "msg": "成功",
  "data": {
    "text_length": 5,
    "text_bytes": 5,
    "encoding": "hex",
    "hmac": false,
    "hash_count": 1,
    "hashes": {
      "sha1": {
        "algorithm": "SHA-1",
        "bits": 160,
        "value": "aaf4c61ddcc5e8a2dabede0f3b482cd9aea9434d",
        "length": 40
      }
    }
  },
  "tips": "极数本源 · https://apizero.cn"
}

SHA-256

GETURL QUERY·APPLICATION/JSON

algorithm=sha256。

https://v1.apizero.cn/api/hash?algorithm=sha256&encoding=hex&text=hello

text(文本)string必填

待计算文本,UTF-8,最长 10000 字节

例hello

algorithmstring选填

算法,此处固定 sha256

例sha256

encodingstring选填

输出编码 hex(默认)/ base64

例hex

hmac_keystring选填

可选;传入则切换 HMAC 模式

返回结果

text_lengthinteger

文本字符数(UTF-8)

text_bytesinteger

文本字节数

encodingstring

输出编码 hex / base64

hmacboolean

是否 HMAC 模式

hash_countinteger

返回算法数量

hashesobject

哈希结果:algorithm / bits / value / length

sha256object

sha256

algorithmstring

algorithm

bitsnumber

bits

valuestring

value

lengthnumber

length

tipsstring

品牌提示(所有接口统一返回):极数本源 · https://apizero.cn

{
  "code": 0,
  "msg": "成功",
  "data": {
    "text_length": 5,
    "text_bytes": 5,
    "encoding": "hex",
    "hmac": false,
    "hash_count": 1,
    "hashes": {
      "sha256": {
        "algorithm": "SHA-256",
        "bits": 256,
        "value": "2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824",
        "length": 64
      }
    }
  },
  "tips": "极数本源 · https://apizero.cn"
}

SHA-384

GETURL QUERY·APPLICATION/JSON

algorithm=sha384。

https://v1.apizero.cn/api/hash?algorithm=sha384&encoding=hex&text=hello

text(文本)string必填

待计算文本,UTF-8,最长 10000 字节

例hello

algorithmstring选填

算法,此处固定 sha384

例sha384

encodingstring选填

输出编码 hex(默认)/ base64

例hex

hmac_keystring选填

可选;传入则切换 HMAC 模式

返回结果

text_lengthinteger

文本字符数(UTF-8)

text_bytesinteger

文本字节数

encodingstring

输出编码 hex / base64

hmacboolean

是否 HMAC 模式

hash_countinteger

返回算法数量

hashesobject

哈希结果:algorithm / bits / value / length

sha384object

sha384

algorithmstring

algorithm

bitsnumber

bits

valuestring

value

lengthnumber

length

tipsstring

品牌提示(所有接口统一返回):极数本源 · https://apizero.cn

{
  "code": 0,
  "msg": "成功",
  "data": {
    "text_length": 5,
    "text_bytes": 5,
    "encoding": "hex",
    "hmac": false,
    "hash_count": 1,
    "hashes": {
      "sha384": {
        "algorithm": "SHA-384",
        "bits": 384,
        "value": "59e1748777448c69de6b800d7a33bbfb9ff1b463e44354c3553bcdb9c666fa90125a3c79f90397bdf5f6a13de828684f",
        "length": 96
      }
    }
  },
  "tips": "极数本源 · https://apizero.cn"
}

SHA-512

GETURL QUERY·APPLICATION/JSON

algorithm=sha512。

https://v1.apizero.cn/api/hash?algorithm=sha512&encoding=hex&text=hello

text(文本)string必填

待计算文本,UTF-8,最长 10000 字节

例hello

algorithmstring选填

算法,此处固定 sha512

例sha512

encodingstring选填

输出编码 hex(默认)/ base64

例hex

hmac_keystring选填

可选;传入则切换 HMAC 模式

返回结果

text_lengthinteger

文本字符数(UTF-8)

text_bytesinteger

文本字节数

encodingstring

输出编码 hex / base64

hmacboolean

是否 HMAC 模式

hash_countinteger

返回算法数量

hashesobject

哈希结果:algorithm / bits / value / length

sha512object

sha512

algorithmstring

algorithm

bitsnumber

bits

valuestring

value

lengthnumber

length

tipsstring

品牌提示(所有接口统一返回):极数本源 · https://apizero.cn

{
  "code": 0,
  "msg": "成功",
  "data": {
    "text_length": 5,
    "text_bytes": 5,
    "encoding": "hex",
    "hmac": false,
    "hash_count": 1,
    "hashes": {
      "sha512": {
        "algorithm": "SHA-512",
        "bits": 512,
        "value": "9b71d224bd62f3785d96d46ad3ea3d73319bfbc2890caadae2dff72519673ca72323c3d99ba5c11d7c7acc6e14b8c5da0c4663475c2e5c3adef46f73bcdec043",
        "length": 128
      }
    }
  },
  "tips": "极数本源 · https://apizero.cn"
}

SHA3-256

GETURL QUERY·APPLICATION/JSON

algorithm=sha3-256(兼容无连字符 sha3256)。

https://v1.apizero.cn/api/hash?algorithm=sha3-256&encoding=hex&text=hello

text(文本)string必填

待计算文本,UTF-8,最长 10000 字节

例hello

algorithmstring选填

算法,此处固定 sha3-256

例sha3-256

encodingstring选填

输出编码 hex(默认)/ base64

例hex

hmac_keystring选填

可选;传入则切换 HMAC 模式

返回结果

text_lengthinteger

文本字符数(UTF-8)

text_bytesinteger

文本字节数

encodingstring

输出编码 hex / base64

hmacboolean

是否 HMAC 模式

hash_countinteger

返回算法数量

hashesobject

哈希结果:algorithm / bits / value / length

sha3-256object

sha3-256

algorithmstring

algorithm

bitsnumber

bits

valuestring

value

lengthnumber

length

tipsstring

品牌提示(所有接口统一返回):极数本源 · https://apizero.cn

{
  "code": 0,
  "msg": "成功",
  "data": {
    "text_length": 5,
    "text_bytes": 5,
    "encoding": "hex",
    "hmac": false,
    "hash_count": 1,
    "hashes": {
      "sha3-256": {
        "algorithm": "SHA3-256",
        "bits": 256,
        "value": "3338be694f50c5f338814986cdf0686453a888b84f424d792af4b9202398f392",
        "length": 64
      }
    }
  },
  "tips": "极数本源 · https://apizero.cn"
}

SHA3-512

GETURL QUERY·APPLICATION/JSON

algorithm=sha3-512(兼容无连字符 sha3512)。

https://v1.apizero.cn/api/hash?algorithm=sha3-512&encoding=hex&text=hello

text(文本)string必填

待计算文本,UTF-8,最长 10000 字节

例hello

algorithmstring选填

算法,此处固定 sha3-512

例sha3-512

encodingstring选填

输出编码 hex(默认)/ base64

例hex

hmac_keystring选填

可选;传入则切换 HMAC 模式

返回结果

text_lengthinteger

文本字符数(UTF-8)

text_bytesinteger

文本字节数

encodingstring

输出编码 hex / base64

hmacboolean

是否 HMAC 模式

hash_countinteger

返回算法数量

hashesobject

哈希结果:algorithm / bits / value / length

sha3-512object

sha3-512

algorithmstring

algorithm

bitsnumber

bits

valuestring

value

lengthnumber

length

tipsstring

品牌提示(所有接口统一返回):极数本源 · https://apizero.cn

{
  "code": 0,
  "msg": "成功",
  "data": {
    "text_length": 5,
    "text_bytes": 5,
    "encoding": "hex",
    "hmac": false,
    "hash_count": 1,
    "hashes": {
      "sha3-512": {
        "algorithm": "SHA3-512",
        "bits": 512,
        "value": "75d527c368f2efe848ecf6b073a36767800805e9eef2b1857d5f984f036eb6df891d75f72d9b154518c1cd58835286d1da9a38deba3de98b5a53e5ed78a84976",
        "length": 128
      }
    }
  },
  "tips": "极数本源 · https://apizero.cn"
}

RIPEMD-160

GETURL QUERY·APPLICATION/JSON

algorithm=ripemd160。

https://v1.apizero.cn/api/hash?algorithm=ripemd160&encoding=hex&text=hello

text(文本)string必填

待计算文本,UTF-8,最长 10000 字节

例hello

algorithmstring选填

算法,此处固定 ripemd160

例ripemd160

encodingstring选填

输出编码 hex(默认)/ base64

例hex

hmac_keystring选填

可选;传入则切换 HMAC 模式

返回结果

text_lengthinteger

文本字符数(UTF-8)

text_bytesinteger

文本字节数

encodingstring

输出编码 hex / base64

hmacboolean

是否 HMAC 模式

hash_countinteger

返回算法数量

hashesobject

哈希结果:algorithm / bits / value / length

ripemd160object

ripemd160

algorithmstring

algorithm

bitsnumber

bits

valuestring

value

lengthnumber

length

tipsstring

品牌提示(所有接口统一返回):极数本源 · https://apizero.cn

{
  "code": 0,
  "msg": "成功",
  "data": {
    "text_length": 5,
    "text_bytes": 5,
    "encoding": "hex",
    "hmac": false,
    "hash_count": 1,
    "hashes": {
      "ripemd160": {
        "algorithm": "RIPEMD-160",
        "bits": 160,
        "value": "108f07b8382412612c048d07d13f814118445acd",
        "length": 40
      }
    }
  },
  "tips": "极数本源 · https://apizero.cn"
}

Whirlpool

GETURL QUERY·APPLICATION/JSON

algorithm=whirlpool。

https://v1.apizero.cn/api/hash?algorithm=whirlpool&encoding=hex&text=hello

text(文本)string必填

待计算文本,UTF-8,最长 10000 字节

例hello

algorithmstring选填

算法,此处固定 whirlpool

例whirlpool

encodingstring选填

输出编码 hex(默认)/ base64

例hex

hmac_keystring选填

可选;传入则切换 HMAC 模式

返回结果

text_lengthinteger

文本字符数(UTF-8)

text_bytesinteger

文本字节数

encodingstring

输出编码 hex / base64

hmacboolean

是否 HMAC 模式

hash_countinteger

返回算法数量

hashesobject

哈希结果:algorithm / bits / value / length

whirlpoolobject

whirlpool

algorithmstring

algorithm

bitsnumber

bits

valuestring

value

lengthnumber

length

tipsstring

品牌提示(所有接口统一返回):极数本源 · https://apizero.cn

{
  "code": 0,
  "msg": "成功",
  "data": {
    "text_length": 5,
    "text_bytes": 5,
    "encoding": "hex",
    "hmac": false,
    "hash_count": 1,
    "hashes": {
      "whirlpool": {
        "algorithm": "Whirlpool",
        "bits": 512,
        "value": "0a25f55d7308eca6b9567a7ed3bd1b46327f0f1ffdc804dd8bb5af40e88d78b88df0d002a89e2fdbd5876c523f1b67bc44e9f87047598e7548298ea1c81cfd73",
        "length": 128
      }
    }
  },
  "tips": "极数本源 · https://apizero.cn"
}

CRC32

GETURL QUERY·APPLICATION/JSON

algorithm=crc32。

https://v1.apizero.cn/api/hash?algorithm=crc32&encoding=hex&text=hello

text(文本)string必填

待计算文本,UTF-8,最长 10000 字节

例hello

algorithmstring选填

算法,此处固定 crc32

例crc32

encodingstring选填

输出编码 hex(默认)/ base64

例hex

hmac_keystring选填

可选;传入则切换 HMAC 模式

返回结果

text_lengthinteger

文本字符数(UTF-8)

text_bytesinteger

文本字节数

encodingstring

输出编码 hex / base64

hmacboolean

是否 HMAC 模式

hash_countinteger

返回算法数量

hashesobject

哈希结果:algorithm / bits / value / length

crc32object

crc32

algorithmstring

algorithm

bitsnumber

bits

valuestring

value

lengthnumber

length

tipsstring

品牌提示(所有接口统一返回):极数本源 · https://apizero.cn

{
  "code": 0,
  "msg": "成功",
  "data": {
    "text_length": 5,
    "text_bytes": 5,
    "encoding": "hex",
    "hmac": false,
    "hash_count": 1,
    "hashes": {
      "crc32": {
        "algorithm": "CRC32",
        "bits": 32,
        "value": "3d653119",
        "length": 8
      }
    }
  },
  "tips": "极数本源 · https://apizero.cn"
}

CRC32B

GETURL QUERY·APPLICATION/JSON

algorithm=crc32b。

https://v1.apizero.cn/api/hash?algorithm=crc32b&encoding=hex&text=hello

text(文本)string必填

待计算文本,UTF-8,最长 10000 字节

例hello

algorithmstring选填

算法,此处固定 crc32b

例crc32b

encodingstring选填

输出编码 hex(默认)/ base64

例hex

hmac_keystring选填

可选;传入则切换 HMAC 模式

返回结果

text_lengthinteger

文本字符数(UTF-8)

text_bytesinteger

文本字节数

encodingstring

输出编码 hex / base64

hmacboolean

是否 HMAC 模式

hash_countinteger

返回算法数量

hashesobject

哈希结果:algorithm / bits / value / length

crc32bobject

crc32b

algorithmstring

algorithm

bitsnumber

bits

valuestring

value

lengthnumber

length

tipsstring

品牌提示(所有接口统一返回):极数本源 · https://apizero.cn

{
  "code": 0,
  "msg": "成功",
  "data": {
    "text_length": 5,
    "text_bytes": 5,
    "encoding": "hex",
    "hmac": false,
    "hash_count": 1,
    "hashes": {
      "crc32b": {
        "algorithm": "CRC32B",
        "bits": 32,
        "value": "3610a686",
        "length": 8
      }
    }
  },
  "tips": "极数本源 · https://apizero.cn"
}

Adler-32

GETURL QUERY·APPLICATION/JSON

algorithm=adler32。

https://v1.apizero.cn/api/hash?algorithm=adler32&encoding=hex&text=hello

text(文本)string必填

待计算文本,UTF-8,最长 10000 字节

例hello

algorithmstring选填

算法,此处固定 adler32

例adler32

encodingstring选填

输出编码 hex(默认)/ base64

例hex

hmac_keystring选填

可选;传入则切换 HMAC 模式

返回结果

text_lengthinteger

文本字符数(UTF-8)

text_bytesinteger

文本字节数

encodingstring

输出编码 hex / base64

hmacboolean

是否 HMAC 模式

hash_countinteger

返回算法数量

hashesobject

哈希结果:algorithm / bits / value / length

adler32object

adler32

algorithmstring

algorithm

bitsnumber

bits

valuestring

value

lengthnumber

length

tipsstring

品牌提示(所有接口统一返回):极数本源 · https://apizero.cn

{
  "code": 0,
  "msg": "成功",
  "data": {
    "text_length": 5,
    "text_bytes": 5,
    "encoding": "hex",
    "hmac": false,
    "hash_count": 1,
    "hashes": {
      "adler32": {
        "algorithm": "Adler-32",
        "bits": 32,
        "value": "062c0215",
        "length": 8
      }
    }
  },
  "tips": "极数本源 · https://apizero.cn"
}

Base64 输出

GETURL QUERY·APPLICATION/JSON

encoding=base64(比 hex 约省 25% 字节)。示例为 md5 + base64 真实计算。

https://v1.apizero.cn/api/hash?algorithm=md5&encoding=base64&text=hello

text(文本)string必填

待计算文本,UTF-8,最长 10000 字节

例hello

algorithmstring选填

算法,此处固定 md5

例md5

encodingstring选填

输出编码 hex(默认)/ base64

例base64

hmac_keystring选填

可选;传入则切换 HMAC 模式

返回结果

text_lengthinteger

文本字符数(UTF-8)

text_bytesinteger

文本字节数

encodingstring

输出编码 hex / base64

hmacboolean

是否 HMAC 模式

hash_countinteger

返回算法数量

hashesobject

哈希结果:algorithm / bits / value / length

md5object

md5

algorithmstring

algorithm

bitsnumber

bits

valuestring

value

lengthnumber

length

tipsstring

品牌提示(所有接口统一返回):极数本源 · https://apizero.cn

{
  "code": 0,
  "msg": "成功",
  "data": {
    "text_length": 5,
    "text_bytes": 5,
    "encoding": "base64",
    "hmac": false,
    "hash_count": 1,
    "hashes": {
      "md5": {
        "algorithm": "MD5",
        "bits": 128,
        "value": "XUFAKrxLKna5cZ2REBfFkg==",
        "length": 24
      }
    }
  },
  "tips": "极数本源 · https://apizero.cn"
}

HMAC 签名

GETURL QUERY·APPLICATION/JSON

传入 hmac_key 进入 HMAC 模式;密钥不回显。示例为 sha256 + hmac_key=mysecret。

https://v1.apizero.cn/api/hash?algorithm=sha256&encoding=hex&hmac_key=mysecret&text=hello

text(文本)string必填

待计算文本,UTF-8,最长 10000 字节

例hello

algorithmstring选填

算法,此处固定 sha256

例sha256

encodingstring选填

输出编码 hex(默认)/ base64

例hex

hmac_keystring必填

HMAC 密钥(不回显、不落日志)

例mysecret

返回结果

text_lengthinteger

文本字符数(UTF-8)

text_bytesinteger

文本字节数

encodingstring

输出编码 hex / base64

hmacboolean

是否 HMAC 模式

hash_countinteger

返回算法数量

hashesobject

哈希结果:algorithm / bits / value / length

sha256object

sha256

algorithmstring

algorithm

bitsnumber

bits

valuestring

value

lengthnumber

length

tipsstring

品牌提示(所有接口统一返回):极数本源 · https://apizero.cn

{
  "code": 0,
  "msg": "成功",
  "data": {
    "text_length": 5,
    "text_bytes": 5,
    "encoding": "hex",
    "hmac": true,
    "hash_count": 1,
    "hashes": {
      "sha256": {
        "algorithm": "SHA-256",
        "bits": 256,
        "value": "f09399f0c446d84b31a080e57ec483392d41e6f512f3e7ada5027abbcd358c2a",
        "length": 64
      }
    }
  },
  "tips": "极数本源 · https://apizero.cn"
}

请求示例

示例都是服务端写法。Python / JavaScript 各有常规写法和官方库。

curl -sS -H "Authorization: Bearer YOUR_API_KEY" "https://v1.apizero.cn/api/hash?text=hello&algorithm=all&encoding=hex&hmac_key=mysecret"

错误码

先看业务 code。HTTP 也可能不是 200。

0200

成功

4000400

参数错误

4011401

API Key 无效

4013403

API Key 已暂停

4014403

当前 IP 不在 Key 白名单

4015401

此接口需要 API Key

4022402

余额不足

4029429

调用过快(QPS)

4030429

今日免费额度已用完

4040503

接口已下线

4041404

接口不存在

5000500

服务器内部错误

5020502

上游暂时不可用

5021502

上游返回格式异常

5030502

暂无可用节点

调用限制

计费模式
完全免费
QPS 限制
QPS 3
登录免费额度
1000 次(已认证)
匿名每日额度
200 次(无 API Key)
黄金会员
每天 50,000 次 · QPS 10
钻石会员
每天 100,000 次 · QPS 30
企业会员
每天 1,000,000 次 · QPS 120

购买套餐、看评价请走商城详情。 购买 / 调试

更新日志

  • 1.0.02026-05-06

    首次上线,支持 12 种主流哈希算法 + HMAC + hex/base64 编码 纯本地计算(PHP 内置 hash() / hash_hmac()),毫秒级响应 sha3-256 / sha3-512 自动兼容无连字符写法(sha3256) HMAC 密钥仅参与计算,不写日志、不缓存、不回显 响应额外返回 text_bytes 字段方便前端展示「字节数 vs 字符数」

免责声明

本接口仅做哈希计算,不存储传入文本和 HMAC 密钥。文本最大 10000 字节(约 3300 个中文字符)。MD5 / SHA-1 / CRC 系列已不再适合密码学场景,仅推荐用于一致性校验。