-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from Willywes/analysis-ajrd70
Apply fixes from StyleCI
- Loading branch information
Showing
7 changed files
with
185 additions
and
173 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,36 @@ | ||
<?php | ||
|
||
function generateRecordingKey($appID, $appCertificate, $channelName, $ts, $randomInt, $uid, $expiredTs ,$serviceType='ARS') | ||
function generateRecordingKey($appID, $appCertificate, $channelName, $ts, $randomInt, $uid, $expiredTs, $serviceType = 'ARS') | ||
{ | ||
return generateDynamicKey($appID, $appCertificate, $channelName, $ts, $randomInt, $uid, $expiredTs ,$serviceType); | ||
return generateDynamicKey($appID, $appCertificate, $channelName, $ts, $randomInt, $uid, $expiredTs, $serviceType); | ||
} | ||
|
||
function generateMediaChannelKey($appID, $appCertificate, $channelName, $ts, $randomInt, $uid, $expiredTs ,$serviceType='ACS') | ||
function generateMediaChannelKey($appID, $appCertificate, $channelName, $ts, $randomInt, $uid, $expiredTs, $serviceType = 'ACS') | ||
{ | ||
return generateDynamicKey($appID, $appCertificate, $channelName, $ts, $randomInt, $uid, $expiredTs ,$serviceType); | ||
return generateDynamicKey($appID, $appCertificate, $channelName, $ts, $randomInt, $uid, $expiredTs, $serviceType); | ||
} | ||
|
||
function generateDynamicKey($appID, $appCertificate, $channelName, $ts, $randomInt, $uid, $expiredTs ,$serviceType) | ||
function generateDynamicKey($appID, $appCertificate, $channelName, $ts, $randomInt, $uid, $expiredTs, $serviceType) | ||
{ | ||
$version = "004"; | ||
$version = '004'; | ||
|
||
$randomStr = "00000000" . dechex($randomInt); | ||
$randomStr = substr($randomStr,-8); | ||
$randomStr = '00000000'.dechex($randomInt); | ||
$randomStr = substr($randomStr, -8); | ||
|
||
$uidStr = "0000000000" . $uid; | ||
$uidStr = substr($uidStr,-10); | ||
|
||
$expiredStr = "0000000000" . $expiredTs; | ||
$expiredStr = substr($expiredStr,-10); | ||
$uidStr = '0000000000'.$uid; | ||
$uidStr = substr($uidStr, -10); | ||
|
||
$signature = generateSignature($appID, $appCertificate, $channelName, $ts, $randomStr, $uidStr, $expiredStr ,$serviceType); | ||
$expiredStr = '0000000000'.$expiredTs; | ||
$expiredStr = substr($expiredStr, -10); | ||
|
||
return $version . $signature . $appID . $ts . $randomStr . $expiredStr; | ||
$signature = generateSignature($appID, $appCertificate, $channelName, $ts, $randomStr, $uidStr, $expiredStr, $serviceType); | ||
|
||
return $version.$signature.$appID.$ts.$randomStr.$expiredStr; | ||
} | ||
|
||
function generateSignature($appID, $appCertificate, $channelName, $ts, $randomStr, $uidStr, $expiredStr ,$serviceType) | ||
function generateSignature($appID, $appCertificate, $channelName, $ts, $randomStr, $uidStr, $expiredStr, $serviceType) | ||
{ | ||
$concat = $serviceType . $appID . $ts . $randomStr . $channelName . $uidStr . $expiredStr; | ||
$concat = $serviceType.$appID.$ts.$randomStr.$channelName.$uidStr.$expiredStr; | ||
|
||
return hash_hmac('sha1', $concat, $appCertificate); | ||
} | ||
?> |
Oops, something went wrong.