<?php

//脚本执行指令 php tmp_sig.php
$secret = '5590a339502b133f4d0c545c3cdad159a4827dfccb3f51bb110c56f9b96568ca';
$ts = '1775525663';
$rid = 'req_1775525663_123';
$body = [
    'report_date' => '1775525663',
    'member' => [
        [
            'member_id' => '123',
            'login' => 'zhenhui',
            'ltv_deposit' => 1500,
            'ltv_withdrawal' => 1800,
            'yesterday_total_wl' => -300,
            'yesterday_total_deposit' => 600,
        ],
    ],
];

$json = json_encode($body);
$canonical = $ts . "\n" . $rid . "\nPOST\n/api/v1/mall/dailyPush\n" . hash('sha256', $json);

echo "json={$json}\n";
echo "sha256=" . hash('sha256', $json) . "\n";
echo "X-Signature=" . hash_hmac('sha256', $canonical, $secret) . "\n";

