12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- <?php
- namespace Util\TencentCloud;
- use Mall\Framework\Core\ResultWrapper;
- use Mall\Framework\Core\ErrorCode;
- class Vod
- {
-
- private $secret_id;
-
- private $secret_key;
- public function __construct($secret_id='', $secret_key='')
- {
- $this->secret_id = $secret_id;
- $this->secret_key = $secret_key;
- }
-
- public function getUploadSign()
- {
-
- $arg_list = [
- "secretId" => $this->secret_id,
- "currentTimeStamp" => time(),
- "expireTime" => time() + 86400,
- "random" => rand()
- ];
-
- $orignal = http_build_query($arg_list);
- $signature = base64_encode(hash_hmac('SHA1', $orignal, $this->secret_key, true).$orignal);
- return ResultWrapper::success($signature);
- }
- }
|