- hash: documentation ( source)
- strtotime: documentation ( source)
- gmdate: documentation ( source)
<?php
$appId = "16961";
$secret= "1c99b315c7cc4009a9fbce37b885abbc";
$userid = null;
$time = gmdate("Y-m-d\TH:i:s");
$unixTime = @strtotime($time."Z");
$signature = hash('sha256', ($userid?$userid:"").$appId.$unixTime.$secret);
echo "/auth/get-token?appId={$appId}".($userid?"&userid={$userid}":"")."×tamp={$time}&signature={$signature}";
echo "\n\n";
$token = "0_16961_1409345448_2_3f967b8531d8d651a2a2a79136329aeba76dce85e29b8d943c6d2643f5ae5322";
echo "&token=" .$token ."&hash=" .hash('sha256', $token .$secret);