Hash
The /hash endpoint converts a string into a hash, i.e. a string of characters that cannot be reversed into the original string.
POST/v5/hash
Parameters
| Parameter | Required | Description |
|---|---|---|
text | Yes | The string to hash (word, sentence, paragraph, etc.) |
method | Yes | The hashing method to use (see available methods below) |
encoding | No | Output encoding: hex (default) or base64 |
Available Methods
Click to expand all available hashing methods
RSA Methods:
RSA-MD5RSA-RIPEMD160RSA-SHA1RSA-SHA1-2RSA-SHA224RSA-SHA256RSA-SHA3-224RSA-SHA3-256RSA-SHA3-384RSA-SHA3-512RSA-SHA384RSA-SHA512RSA-SHA512/224RSA-SHA512/256RSA-SM3
Blake Methods:
blake2b512blake2s256
SHA Methods:
sha1sha224sha256sha384sha512sha512-224sha512-256sha3-224sha3-256sha3-384sha3-512
MD5 Methods:
md5md5-sha1md5WithRSAEncryption
RIPEMD Methods:
ripemdripemd160ripemd160WithRSArmd160
Other Methods:
shake128shake256sm3sm3WithRSAEncryptionssl3-md5ssl3-sha1
RSA Encryption Methods:
sha1WithRSAEncryptionsha224WithRSAEncryptionsha256WithRSAEncryptionsha384WithRSAEncryptionsha512WithRSAEncryptionsha512-224WithRSAEncryptionsha512-256WithRSAEncryption
PKCS Methods:
id-rsassa-pkcs1-v1_5-with-sha3-224id-rsassa-pkcs1-v1_5-with-sha3-256id-rsassa-pkcs1-v1_5-with-sha3-384id-rsassa-pkcs1-v1_5-with-sha3-512
Code Examples
curl -X POST \
-H "Content-Type: application/json" \
-d '{
"text": "hello",
"method": "sha256",
"encoding": "base64"
}' \
"https://api.sylvain.sh/v5/hash"Response Fields
| Field | Type | Description |
|---|---|---|
method | string | Hashing method used |
hash | string | Resulting hash string (hex or base64 encoded digest) |
Try It
Error Handling
If parameters are missing or invalid, the API will return an error:
| Error Message | Description |
|---|---|
Please provide a text (?text={text}) | The text parameter is missing |
Text is required | The text parameter is empty |
Please provide a valid hash algorithm (&method={algorithm}) | The method parameter is missing or invalid |
Unsupported method. Use one of: {methods} | The method is not a supported hash algorithm |
Encoding must be one of: hex, base64 | Invalid encoding value |