Hachage
L'endpoint /hash permet de convertir un texte en hash, c'est-à-dire en un code unique et crypté.
POST/v2/hash
Paramètres
| Paramètre | Requis | Description |
|---|---|---|
text | Oui | Le texte à hasher, peut être un mot, une phrase, un texte complet... |
method | Oui | Le type de hash à utiliser (voir les méthodes disponibles ci-dessous) |
Méthodes disponibles
RSA-MD5RSA-RIPEMD160RSA-SHA1RSA-SHA1-2RSA-SHA224RSA-SHA256RSA-SHA3-224RSA-SHA3-256RSA-SHA3-384RSA-SHA3-512RSA-SHA384RSA-SHA512RSA-SHA512/224RSA-SHA512/256RSA-SM3blake2b512blake2s256id-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-512md5md5-sha1md5WithRSAEncryptionripemdripemd160ripemd160WithRSArmd160sha1sha1WithRSAEncryptionsha224sha224WithRSAEncryptionsha256sha256WithRSAEncryptionsha3-224sha3-256sha3-384sha3-512sha384sha384WithRSAEncryptionsha512sha512-224sha512-224WithRSAEncryptionsha512-256sha512-256WithRSAEncryptionsha512WithRSAEncryptionshake128shake256sm3sm3WithRSAEncryptionssl3-md5ssl3-sha1
Exemple de requête
bash
curl -X POST -d "text=hello&method=sha512" "https://api.sylvain.pro/v2/hash"Réponse
json
{
"method": "sha512",
"hash": "9b71d224bd62f3785d96d46ad3ea3d73319bfbc2890caadae2dff72519673ca72323c3d99ba5c11d7c7acc6e14b8c5da0c4663475c2e5c3adef46f73bcdec043"
}Gestion des erreurs
Si la valeur de text ou method est vide ou invalide, une erreur sera renvoyée.