You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
411 B
PHTML
23 lines
411 B
PHTML
6 years ago
|
<?php
|
||
|
|
||
|
include_once "errorCode.php";
|
||
|
|
||
|
class SHA1
|
||
|
{
|
||
|
public function getSHA1($token, $timestamp, $nonce, $encrypt_msg)
|
||
|
{
|
||
|
try {
|
||
|
$array = array($encrypt_msg, $token, $timestamp, $nonce);
|
||
|
sort($array, SORT_STRING);
|
||
|
$str = implode($array);
|
||
|
return array(ErrorCode::$OK, sha1($str));
|
||
|
} catch (Exception $e) {
|
||
|
print $e . "\n";
|
||
|
return array(ErrorCode::$ComputeSignatureError, null);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
}
|
||
|
|
||
|
|
||
|
?>
|