hash
POST1 tín dụngComputes a cryptographic hash of a UTF-8 string. Useful for content fingerprinting, deduplication, and verifying integrity without sending the payload to a third-party service.
Endpoint
POST https://x114.org/api/v1/hashBody yêu cầu
Mô tả payload yêu cầu.
| Name | Type | Required | Description |
|---|---|---|---|
| text | string | required | The input text to hash. Up to 1 MB. |
| algorithm | "sha1" | "sha256" | "sha384" | "sha512" | optional | Hash algorithm. Defaults to "sha256". |
Body phản hồi
Phản hồi thành công được trả về dưới dạng JSON.
| Name | Type | Required | Description |
|---|---|---|---|
| ok | boolean | required | True on success. |
| algorithm | string | required | The algorithm used (uppercased). |
| hash | string (hex) | required | Hex-encoded digest. |
| length | number | required | Length of the hex digest in characters (algorithm-dependent). |
Ví dụ
curl -X POST https://x114.org/api/v1/hash \
-H "Authorization: Bearer sk_..." \
-H "Content-Type: application/json" \
-d '{"text":"hello world","algorithm":"SHA-256"}'