<?php
// ============================================
// test_signature_server.php
// ทดสอบคำนวณ signature แบบเดียวกับ Client
// ============================================

header("Content-Type: application/json; charset=utf-8");

$TOKEN = "PACKBEACON2025";
$SECRET = "PackBeacon@Secure!";
$timestamp = time();

$signature = hash_hmac("sha256", $TOKEN . $timestamp, $SECRET);

echo json_encode([
    "status" => "success",
    "info" => "Signature นี้เซิร์ฟเวอร์ใช้ตรวจสอบ",
    "token" => $TOKEN,
    "timestamp" => $timestamp,
    "signature" => $signature,
    "verify_url" => "https://pack.iot-cm.com/api-secure/test_signature_verify.php"
], JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE);
