请看代码
莫限行api 接口
$outArr = array(
'code' => 1,
'msg' => '',
'data' => array(),
);
// 云市场分配的密钥Id
$secretId = '';
// 云市场分配的密钥Key
$secretKey = '';
$source = 'market';
// 签名
$datetime = gmdate('D, d M Y H:i:s T');
$signStr = sprintf("x-date: %s\nx-source: %s", $datetime, $source);
$sign = base64_encode(hash_hmac('sha1', $signStr, $secretKey, true));
$auth = sprintf('hmac id="%s", algorithm="hmac-sha1", headers="x-date x-source", signature="%s"', $secretId, $sign);
//