Overview

Packages

  • None
  • WxRobot
    • Admin
    • Cmd
    • CoreFunctions
    • Exends
    • Install
    • Table
    • Uninstall
    • WxSDK

Classes

  • ErrorCode
  • PKCS7Encoder
  • Prpcrypt
  • SHA1
  • Weixin_BaseCore
  • WeiXin_SDK
  • Weixin_Template
  • WXBizMsgCrypt
  • WxRobot_Admin
  • WxRobot_Admin_Menu_Extends
  • WxRobot_Admin_Menu_Instro
  • WxRobot_Admin_Menu_Menu
  • WxRobot_Admin_Menu_Records
  • WxRobot_Admin_Menu_Reply
  • WxRobot_Admin_Menu_Setting
  • WxRobot_Admin_Menu_Statistics
  • WxRobot_Cmd
  • WxRobot_Cmd_Event
  • WxRobot_Cmd_Event_User
  • WxRobot_Cmd_Text
  • WxRobot_Extends
  • WxRobot_Install
  • WxRobot_Robot
  • WxRobot_SDK
  • WxRobot_Table_Extends
  • WxRobot_Table_Menu
  • WxRobot_Table_Records
  • WxRobot_Table_Reply
  • WxRobot_Uninstall
  • WxRobot_Wp
  • XMLParse

Functions

  • wx_admin_log
  • wx_is_xml
  • wx_notice_msg
  • wx_parse_xml
  • wx_random_big_pic
  • wx_random_small_pic
  • wx_request_array
  • wx_request_decode
  • wx_request_is_encode
  • wx_request_xml
  • wx_send_encode
  • Overview
  • Package
  • Class
 1: <?php
 2: 
 3: include_once "errorCode.php";
 4: 
 5: /**
 6:  * SHA1 class
 7:  *
 8:  * 计算公众平台的消息签名接口.
 9:  */
10: class SHA1
11: {
12:     /**
13:      * 用SHA1算法生成安全签名
14:      * @param string $token 票据
15:      * @param string $timestamp 时间戳
16:      * @param string $nonce 随机字符串
17:      * @param string $encrypt 密文消息
18:      */
19:     public function getSHA1($token, $timestamp, $nonce, $encrypt_msg)
20:     {
21:         //排序
22:         try {
23:             $array = array($encrypt_msg, $token, $timestamp, $nonce);
24:             sort($array, SORT_STRING);
25:             $str = implode($array);
26:             return array(ErrorCode::$OK, sha1($str));
27:         } catch (Exception $e) {
28:             //print $e . "\n";
29:             return array(ErrorCode::$ComputeSignatureError, null);
30:         }
31:     }
32: 
33: }
34: 
35: 
36: ?>
API documentation generated by ApiGen