Эндпоинт
POST /api.php
Поддерживаемые версии
crypt → RSA v1
crypt2 → RSA v2
crypt3 → RSA v3
Расшифровка
{
"action": "decode",
"data": "happ://crypt3/..."
}
Шифровка
{
"action": "encode",
"version": "crypt3",
"data": "https://example.com"
}
Примеры
cURL
curl -X POST https://happ.shandy.dev/api.php \
-H "Content-Type: application/json" \
-d '{"action":"encode","version":"crypt3","data":"https://sub.example.com"}'
curl -X POST https://happ.shandy.dev/api.php \
-H "Content-Type: application/json" \
-d '{"action":"decode","data":"happ://crypt3/..."}'
Python requests
import requests
# Шифровка
resp = requests.post("https://happ.shandy.dev/api.php", json={
"action": "encode",
"version": "crypt3",
"data": "https://sub.example.com"
})
print(resp.json())
# Расшифровка
resp = requests.post("https://happ.shandy.dev/api.php", json={
"action": "decode",
"data": "happ://crypt3/..."
})
print(resp.json())
Node.js fetch
const r = await fetch("https://happ.shandy.dev/api.php", {
method: "POST",
headers: {"Content-Type": "application/json"},
body: JSON.stringify({ action: "encode", version: "crypt3", data: "https://sub.example.com" })
});
console.log(await r.json());
const r2 = await fetch("https://happ.shandy.dev/api.php", {
method: "POST",
headers: {"Content-Type": "application/json"},
body: JSON.stringify({ action: "decode", data: "happ://crypt3/..." })
});
console.log(await r2.json());