diff --git a/.gitignore b/.gitignore
index 779e19d..bfec22f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
 .idea
 .vscode
 /vendor/
+.DS_Store
\ No newline at end of file
diff --git a/LICENSE b/LICENSE
index 61846df..b9f3734 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,6 +1,6 @@
 MIT License
 
-Copyright (c) 2018 shinn lancelot
+Copyright (c) 2018-present shinn_lancelot
 
 Permission is hereby granted, free of charge, to any person obtaining a copy
 of this software and associated documentation files (the "Software"), to deal
diff --git a/README.md b/README.md
index d0b75cc..f770345 100644
--- a/README.md
+++ b/README.md
@@ -1,155 +1,16 @@
-# 微信小程序php后端开发包
+## MiniProgramSDK
 
-[![issue](https://img.shields.io/github/issues/hillpy/MiniProgramSDK.svg)](https://github.com/hillpy/MiniProgramSDK/issues)
-[![star](https://img.shields.io/github/stars/hillpy/MiniProgramSDK.svg)](https://github.com/hillpy/MiniProgramSDK)
-[![fork](https://img.shields.io/github/forks/hillpy/MiniProgramSDK.svg)](https://github.com/hillpy/MiniProgramSDK)
 [![license](https://img.shields.io/github/license/hillpy/MiniProgramSDK.svg)](https://github.com/hillpy/MiniProgramSDK/blob/master/LICENSE)
+[![release](https://img.shields.io/github/release/hillpy/MiniProgramSDK.svg)](https://img.shields.io/github/release/hillpy/MiniProgramSDK.svg)
+[![packagist](https://img.shields.io/packagist/v/hillpy/mini-program-sdk.svg)](https://packagist.org/packages/hillpy/mini-program-sdk)
+[![downloads](https://img.shields.io/packagist/dt/hillpy/mini-program-sdk.svg)](https://img.shields.io/packagist/dt/hillpy/mini-program-sdk.svg)
 
-### 功能描述
-#### 封装微信小程序php端相关接口，比如php端微信用户信息解密（即登陆功能）、获取sessionKey、获取小程序码等等。
-
-### 安装方法
-
-1. 下载[发行版](https://github.com/hillpy/MiniProgramSDK/releases)
-
-2. 使用composer安装（推荐）
-
-```
-composer require hillpy/mini-program-sdk
-```
-
-### 使用方法
-
-* 实例化开发包、accessToken获取及缓存
-
-```
-/**
- * 使用案例
- * 注意：实际项目若使用composer安装的库，请先引入自动加载脚本（require __DIR__ . '/vender/autoload.php';）。另外需安装redis扩展并开启redis服务
- */
-use hillpy\MiniProgramSDK\MiniProgram;
-
-// 设置变量
-$appId = '';
-$appSecret = '';
-$accessToken = '';
-
-// 从redis获取accessToken;
-$redis = new Redis();
-$redis->connect('127.0.0.1', 6379);
-$accessToken = $redis->get('miniprogram_access_token_appid_' . $appId);
-
-// 实例化MiniProgram
-$miniProgram = new MiniProgram($appId, $appSecret, $accessToken);
-
-//若缓存中不存在accessToken，从新实例化对象中获取并写入redis
-if (!$accessToken) {
-    isset($miniProgram->accessTokenData['access_token']) && $accessToken = $miniProgram->accessTokenData['access_token'];
-
-    if ($accessToken) {
-        // 获取的expires_in为秒时间戳，减去30秒（过期时间适当提前避免accessToken实际已失效）
-        if (isset($miniProgram->accessTokenData['expires_in'])) {
-            $cacheTime = $miniProgram->accessTokenData['expires_in'] - 30;
-        } else {
-            $cacheTime = 0;
-        }
-        $redis->setex('miniprogram_access_token_appid_' . $appId, $cacheTime, $accessToken);
-    }
-}
-
-// 输出accessToken
-if ($accessToken == '') {
-    echo 'accessToken获取失败<br>';
-} else {
-    echo 'accessToken:' . $accessToken . '<br>';
-}
-```
-
-* 解密登录用户数据
-
-```
-// 解密登录用户数据
-$paramArr['code'] = isset($_POST['code']) ? $_POST['code'] : '';
-$paramArr['rawData'] = isset($_POST['rawData']) ? $_POST['rawData'] : '';
-$paramArr['signature'] = isset($_POST['signature']) ? $_POST['signature'] : '';
-$paramArr['encryptedData'] = isset($_POST['encryptedData']) ? $_POST['encryptedData'] : '';
-$paramArr['iv'] = isset($_POST['iv']) ? $_POST['iv'] : '';
-$paramArr['sessionKeyExpired'] = isset($_POST['sessionKeyExpired']) ? $_POST['sessionKeyExpired'] : '';
-
-// sessionKeyExpired参数表示session_key是否过期（必须由前端判断），未过期则从缓存获取sessionKeyData
-if ($paramArr['sessionKeyExpired'] != 1) {
-    $sessionKeyData = $redis->get('miniprogram_jscode2session_appid_' . $appId);
-    $sessionKeyDataArr = json_decode($sessionKeyData, true);
-    $paramArr['sessionKey'] = $sessionKeyDataArr['sessionKey'];
-    $paramArr['openId'] = $sessionKeyDataArr['openId'];
-}
-
-$res = $miniProgram->decryptData($paramArr);
-
-if ($res['code'] == 100) {
-    // 将sessionKeyData写入缓存
-    $sessionKeyDataArr['sessionKey'] = $res['data']['sessionKey'];
-    $sessionKeyDataArr['openId'] = $res['data']['data']['openId'];
-    $redis->set('miniprogram_jscode2session_appid_' . $appId, json_encode($sessionKeyDataArr));
-
-    echo '解密成功';
-} else {
-    echo $res['msg'];
-}
-```
-
-* 获取无数量限制的小程序码
-
-```
-// 小程序码图片的保存路径
-$path = '';
-// 小程序码图片的保存名称
-$filename = '';
-
-// 小程序码接口所需参数
-$paramArr['scene'] = '';
-$paramArr['page'] = '';
-$paramArr['width'] = '';
-$paramArr['auto_color'] = '';
-$paramArr['line_color'] = '';
-$paramArr['is_hyaline'] = '';
-
-// 请求小程序码接口
-$res = $miniProgram->getWxacodeUnlimit($paramArr);
-
-// 打开文件并写入二进制流，生成图片
-$file = fopen($path . $filename, 'w');
-fwrite($file, $res);
-fclose($file);
-```
-
-### TODO
-
-~~1. 微信用户数据解密~~
-
-~~2. 小程序二维码、小程序码~~
-
-3. 模板消息
-
-4. 统一服务消息
-
-5. 动态消息
-
-6. 客服消息
-
-7. 数据分析
-
-8. 附近的小程序
-
-9. 插件管理
-
-10. 内容安全
+> MiniProgramSDK是一个PHP的小程序开发包。封装微信小程序后端相关接口，比如解密信息（用户信息、手机号）、获取小程序码等。
 
 ### 仓库地址
 
-[Coding](https://coding.net/u/shinn_lancelot/p/MiniProgramSDK/git "MiniProgramSDK")<br>
-[Gitee](https://gitee.com/hillpy/MiniProgramSDK "MiniProgramSDK")<br>
 [Github](https://github.com/hillpy/MiniProgramSDK "MiniProgramSDK")<br>
+[Gitee](https://gitee.com/hillpy/MiniProgramSDK "MiniProgramSDK")<br>
 
 ### 协议
 
diff --git a/composer.json b/composer.json
index cbed262..728d1a7 100644
--- a/composer.json
+++ b/composer.json
@@ -1,13 +1,13 @@
 {
     "name": "hillpy/mini-program-sdk",
-    "description": "微信小程序后端php开发包，封装微信小程序php端相关接口，比如php端微信用户信息解密（即登陆功能）、获取sessionKey、获取小程序码等",
+    "description": "MiniProgramSDK是一个PHP的小程序开发包。封装微信小程序后端相关接口，比如解密信息（用户信息、手机号）、获取小程序码等。",
     "keywords": ["小程序", "miniprogram", "微信", "wechat"],
     "type": "library",
     "license": "MIT",
     "authors": [
         {
             "name": "shinn_lancelot",
-            "email": "945226793@qq.com",
+            "email": "lanhaichun0317@gmail.com",
             "homepage": "https://hillpy.com",
             "role": "Developer"
         }
diff --git a/demo.php b/demo.php
index e3d693c..a46d72b 100644
--- a/demo.php
+++ b/demo.php
@@ -2,31 +2,31 @@
 
 /**
  * 使用案例
- * 注意：实际项目若使用composer安装的库，请先引入自动加载脚本（require __DIR__ . '/vender/autoload.php';），此例子中直接引用类库。另外需安装redis扩展并开启redis服务
+ * 注意：实际项目若使用composer安装的库，请先引入自动加载脚本（require __DIR__ . '/vender/autoload.php';），此例子中直接引用类库。另外需安装redis扩展并开启redis服务。
  */
 require __DIR__ . '/src/MiniProgram.php';
 
 use hillpy\MiniProgramSDK\MiniProgram;
 
-// 设置变量
-$appId = '';
-$appSecret = '';
+// 设置变量。
+$appId = '小程序APPID';
+$appSecret = '小程序APPSECRET';
 $accessToken = '';
 
-// 从redis获取accessToken;
+// 从redis获取accessToken。
 $redis = new Redis();
 $redis->connect('127.0.0.1', 6379);
 $accessToken = $redis->get('miniprogram_access_token_appid_' . $appId);
 
-// 实例化MiniProgram
+// 实例化MiniProgram。
 $miniProgram = new MiniProgram($appId, $appSecret, $accessToken);
 
-//若缓存中不存在accessToken，从新实例化对象中获取并写入redis
+//若缓存中不存在accessToken，从新实例化对象中获取并写入redis。
 if (!$accessToken) {
     isset($miniProgram->accessTokenData['access_token']) && $accessToken = $miniProgram->accessTokenData['access_token'];
 
     if ($accessToken) {
-        // 获取的expires_in为秒时间戳，减去30秒（过期时间适当提前避免accessToken实际已失效）
+        // 获取的expires_in为秒时间戳，减去30秒（过期时间适当提前避免accessToken实际已失效）。
         if (isset($miniProgram->accessTokenData['expires_in'])) {
             $cacheTime = $miniProgram->accessTokenData['expires_in'] - 30;
         } else {
@@ -36,36 +36,35 @@
     }
 }
 
-// 输出accessToken
+// 输出accessToken。
 if ($accessToken == '') {
     echo 'accessToken获取失败<br>';
 } else {
     echo 'accessToken:' . $accessToken . '<br>';
 }
 
-// 解密登录用户数据
+// 客户端请求参数。
 $paramArr['code'] = isset($_POST['code']) ? $_POST['code'] : '';
 $paramArr['rawData'] = isset($_POST['rawData']) ? $_POST['rawData'] : '';
 $paramArr['signature'] = isset($_POST['signature']) ? $_POST['signature'] : '';
 $paramArr['encryptedData'] = isset($_POST['encryptedData']) ? $_POST['encryptedData'] : '';
 $paramArr['iv'] = isset($_POST['iv']) ? $_POST['iv'] : '';
-$paramArr['sessionKeyExpired'] = isset($_POST['sessionKeyExpired']) ? $_POST['sessionKeyExpired'] : '';
+$sessionCacheKey = isset($_POST['sessionCacheKey']) ? $_POST['sessionCacheKey'] : '';
 
-// sessionKeyExpired参数表示session_key是否过期（必须由前端判断），未过期则从缓存获取sessionKeyData
-if ($paramArr['sessionKeyExpired'] != 1) {
-    $sessionKeyData = $redis->get('miniprogram_jscode2session_appid_' . $appId);
-    $sessionKeyDataArr = json_decode($sessionKeyData, true);
-    $paramArr['sessionKey'] = $sessionKeyDataArr['sessionKey'];
-    $paramArr['openId'] = $sessionKeyDataArr['openId'];
-}
+// sessionCacheKey为sessionKey缓存名的一部分。若存在，则从缓存获取。否则，从接口请求。
+$sessionCacheKey && $paramArr['sessionKey'] = $redis->get('miniprogram_session_key_appid_' . $appId . '_key_' . $sessionCacheKey);
 
 $res = $miniProgram->decryptData($paramArr);
 
 if ($res['code'] == 100) {
-    // 将sessionKeyData写入缓存
-    $sessionKeyDataArr['sessionKey'] = $res['data']['sessionKey'];
-    $sessionKeyDataArr['openId'] = $res['data']['data']['openId'];
-    $redis->set('miniprogram_jscode2session_appid_' . $appId, json_encode($sessionKeyDataArr));
+    if (!$sessionCacheKey) {
+        // 将sessionKey写入缓存，过期时间尽量长一些，此处缓存30天。
+        $sessionCacheKey = '随机生成字符串';
+        $redis->setex('miniprogram_session_key_appid_' . $appId . '_key_' . $sessionCacheKey, $res['data']['sessionKey'], 3600 * 24 * 30);
+    }
+
+    // data为解密后的数据。可根据解密数据，做相关处理。如登录注册，并生成jwt。然后将jwt、sessionCacheKey、用户信息返回给小程序端
+    $data = $res['data']['data'];
 
     echo '解密成功';
 } else {
diff --git a/src/Common.php b/src/Common.php
index 34e739c..4715c1b 100644
--- a/src/Common.php
+++ b/src/Common.php
@@ -3,6 +3,7 @@
 /**
  * 通用函数类
  */
+
 namespace hillpy\MiniProgramSDK;
 
 class Common
@@ -30,6 +31,19 @@ public static function httpRequest($url, $data = null)
         return $output;
     }
 
+    /**
+     * 是否为windows系统
+     * @return bool
+     */
+    public static function isWin()
+    {
+        if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
+            return true;
+        } else {
+            return false;
+        }
+    }
+
     /**
      * 获取字符串
      * @param int $type
@@ -58,6 +72,50 @@ public static function getNonce($type = 1, $length = 16)
         return $nonce;
     }
 
+    /**
+     * 根据URandom获取字符串
+     * @param int $length
+     * @return bool|string
+     */
+    public static function getNonceByURandom($length = 16)
+    {
+        $nonce = '';
+        $binary = '';
+        $fp = @fopen('/dev/urandom', 'rb');
+        if ($fp !== false) {
+            $binary .= @fread($fp, $length);
+            @fclose($fp);
+        } else {
+            trigger_error('Can not open /dev/urandom.');
+        }
+        $string = base64_encode($binary);
+        $nonce = substr($string, 0, $length);
+        return $nonce;
+    }
+
+    /**
+     * 扩展原数组的数据（仅更新原数组已有的键）
+     * @param $rawData
+     * @param $newData
+     * @return array
+     */
+    public static function extendArrayData($rawData, $newData)
+    {
+        if (!is_array($rawData) || count($rawData) <= 0) {
+            return array();
+        }
+
+        if (!is_array($newData)) {
+            return $rawData;
+        }
+
+        foreach ($rawData as $key => $value) {
+            isset($newData[$key]) && $rawData[$key] = $newData[$key];
+        }
+
+        return $rawData;
+    }
+
     /**
      * 根据错误码获取错误信息
      * @param $errorCode
@@ -87,4 +145,3 @@ public static function getErrorMsg($errorCode)
         return $errorMsg;
     }
 }
-
diff --git a/src/DefaultParamInfo.php b/src/DefaultParamInfo.php
new file mode 100644
index 0000000..905af0a
--- /dev/null
+++ b/src/DefaultParamInfo.php
@@ -0,0 +1,32 @@
+<?php
+
+return array(
+    'decryptData' => array(
+        'sessionKey' => '',
+        'openId' => '',
+        'code' => '',
+        'rawData' => '',
+        'signature' => '',
+        'encryptedData' => '',
+        'iv' => ''
+    ),
+    'createWXAQRCode' => array(
+        'path' => '',
+        'width' => 430
+    ),
+    'getWXACode' => array(
+        'path' => '',
+        'width' => 430,
+        'auto_color' => false,
+        'line_color' => array('r' => 0, 'g' => 0, 'b' => 0),
+        'is_hyaline' => false
+    ),
+    'getWxacodeUnlimit' => array(
+        'scene' => '',
+        'page' => 'page/index/index',
+        'width' => 430,
+        'auto_color' => false,
+        'line_color' => array('r' => 0, 'g' => 0, 'b' => 0),
+        'is_hyaline' => false
+    )
+);
diff --git a/src/MiniProgram.php b/src/MiniProgram.php
index b3fc4bb..329f800 100644
--- a/src/MiniProgram.php
+++ b/src/MiniProgram.php
@@ -4,6 +4,7 @@
  * 微信小程序api封装类
  * Author: shinn_lancelot
  */
+
 namespace hillpy\MiniProgramSDK;
 
 include "Common.php";
@@ -13,6 +14,7 @@ class MiniProgram
     private $appId = '';
     private $appSecret = '';
     private $accessToken = '';
+    private $defaultParamInfo = array();
     public $accessTokenData = array();
 
     const API_HOST = 'https://api.weixin.qq.com';
@@ -38,6 +40,7 @@ public function __construct($appId, $appSecret, $accessToken = '')
             $this->accessTokenData = $this->getAccessTokenData();
             $this->accessTokenData && $this->accessToken = $this->accessTokenData['access_token'];
         }
+        $this->defaultParamInfo = include_once 'DefaultParamInfo.php';
     }
 
     /**
@@ -47,9 +50,9 @@ public function __construct($appId, $appSecret, $accessToken = '')
     public function getAccessTokenData()
     {
         $urlParamArr = array(
-            'grant_type'=>'client_credential',
-            'appid'=>$this->appId,
-            'secret'=>$this->appSecret
+            'grant_type' => 'client_credential',
+            'appid' => $this->appId,
+            'secret' => $this->appSecret
         );
         $url = self::API_HOST . self::ACCESS_TOKEN_PATH . http_build_query($urlParamArr);
         $res = json_decode(Common::httpRequest($url), true);
@@ -68,13 +71,13 @@ public function getAccessTokenData()
     public function jscode2Session($code)
     {
         $urlParamArr = array(
-            'appid'=>$this->appId,
-            'secret'=>$this->appSecret,
-            'js_code'=>$code,
-            'grant_type'=>'authorization_code'
+            'appid' => $this->appId,
+            'secret' => $this->appSecret,
+            'js_code' => $code,
+            'grant_type' => 'authorization_code'
         );
         $url = self::API_HOST . self::JSCODE_2_SESSSION_PATH . http_build_query($urlParamArr);
-        $res = json_decode(Common::httpRequest($url),true);
+        $res = json_decode(Common::httpRequest($url), true);
         return $res;
     }
 
@@ -85,38 +88,46 @@ public function jscode2Session($code)
      */
     public function decryptData($paramArr = array())
     {
+        // 扩展原参数数组
+        $finalParamArr = Common::extendArrayData($this->defaultParamInfo[__FUNCTION__], $paramArr);
+
         // 初始化返回数据
         $res['code'] = -100;
         $res['msg'] = '操作失败';
         $res['data'] = array();
 
         // 1.获取openid、session_key（若存在session_key，则默认理解为session_key未过期，直接使用其进行解密）
-        if (isset($paramArr['sessionKey']) && $paramArr['sessionKey']) {
-            $openId = isset($paramArr['openId']) ? $paramArr['openId'] : '';
-            $sessionKey = $paramArr['sessionKey'];
+        if ($finalParamArr['sessionKey']) {
+            $sessionKey = $finalParamArr['sessionKey'];
+            $openId = isset($finalParamArr['openId']) ? $finalParamArr['openId'] : '';
         } else {
-            $sessionData = $this->jscode2Session($paramArr['code']);
+            $sessionData = $this->jscode2Session($finalParamArr['code']);
             if (isset($sessionData['errcode'])) {
                 $res['code'] = -101;
                 $res['msg'] = Common::getErrorMsg($sessionData['errcode']);
                 return $res;
             }
-            $openId = $sessionData['openid'];
             $sessionKey = $sessionData['session_key'];
+            $openId = isset($sessionData['openId']) ? $sessionData['openId'] : '';
         }
 
         // 2.计算签名并与传入签名进行校验
-        $newSignature = sha1($paramArr['rawData'] . $sessionKey);
-        if ($newSignature !== $paramArr['signature']) {
-            $res['code'] = -102;
-            $res['msg'] = '签名不匹配';
-            return $res;
+        if (
+            $finalParamArr['rawData'] != '' &&
+            $finalParamArr['signature'] != ''
+        ) {
+            $newSignature = sha1($finalParamArr['rawData'] . $sessionKey);
+            if ($newSignature !== $finalParamArr['signature']) {
+                $res['code'] = -102;
+                $res['msg'] = '签名不匹配';
+                return $res;
+            }
         }
 
         // 3.使用sessionKey解密加密数据包
         include_once "wxBizDataCrypt/wxBizDataCrypt.php";
         $pc = new \WXBizDataCrypt($this->appId, $sessionKey);
-        $errCode = $pc->decryptData($paramArr['encryptedData'], $paramArr['iv'], $data);
+        $errCode = $pc->decryptData($finalParamArr['encryptedData'], $finalParamArr['iv'], $data);
         if (!empty($errCode)) {
             $res['code'] = -103;
             $res['msg'] = Common::getErrorMsg($errCode);
@@ -125,7 +136,7 @@ public function decryptData($paramArr = array())
 
         // 4.生成3rd_session
         $data = json_decode($data, true);
-        $session3rd = Common::getNonce();
+        $session3rd = Common::isWin() === true ? Common::getNonce() : Common::getNonceByURandom();
 
         // 5.返回相关数据
         $res['code'] = 100;
@@ -133,6 +144,7 @@ public function decryptData($paramArr = array())
         $resData['session3rd'] = $session3rd;
         $resData['data'] = $data;
         $resData['sessionKey'] = $sessionKey;
+        $resData['openId'] = $openId;
         $res['data'] = $resData;
         return $res;
     }
@@ -144,41 +156,44 @@ public function decryptData($paramArr = array())
      */
     public function createWXAQRCode($postParamArr = array())
     {
+        $finalParamArr = Common::extendArrayData($this->defaultParamInfo[__FUNCTION__], $postParamArr);
         $urlParamArr = array(
-            'access_token'=>$this->accessToken
+            'access_token' => $this->accessToken
         );
         $url = self::API_HOST . self::WXAQRCODE_PATH . http_build_query($urlParamArr);
-        $res = Common::httpRequest($url, json_encode($postParamArr));
+        $res = Common::httpRequest($url, json_encode($finalParamArr));
         return $res;
     }
 
     /**
-     * 获取小程序码
+     * 获取有数量限制的小程序码
      * @param array $postParamArr
      * @return mixed
      */
     public function getWXACode($postParamArr = array())
     {
+        $finalParamArr = Common::extendArrayData($this->defaultParamInfo[__FUNCTION__], $postParamArr);
         $urlParamArr = array(
-            'access_token'=>$this->accessToken
+            'access_token' => $this->accessToken
         );
         $url = self::API_HOST . self::WXACODE_PATH . http_build_query($urlParamArr);
-        $res = Common::httpRequest($url, json_encode($postParamArr));
+        $res = Common::httpRequest($url, json_encode($finalParamArr));
         return $res;
     }
 
     /**
-     * 获取小程序码（无数量限制）
+     * 获取无数量限制的小程序码
      * @param array $postParamArr
      * @return mixed
      */
     public function getWxacodeUnlimit($postParamArr = array())
     {
+        $finalParamArr = Common::extendArrayData($this->defaultParamInfo[__FUNCTION__], $postParamArr);
         $urlParamArr = array(
-            'access_token'=>$this->accessToken
+            'access_token' => $this->accessToken
         );
         $url = self::API_HOST . self::WXACODE_UNLIMIT_PATH . http_build_query($urlParamArr);
-        $res = Common::httpRequest($url, json_encode($postParamArr));
+        $res = Common::httpRequest($url, json_encode($finalParamArr));
         return $res;
     }
-}
\ No newline at end of file
+}
diff --git a/src/wxBizDataCrypt/errorCode.php b/src/wxBizDataCrypt/errorCode.php
index 9b12a8c..27095ad 100644
--- a/src/wxBizDataCrypt/errorCode.php
+++ b/src/wxBizDataCrypt/errorCode.php
@@ -19,5 +19,3 @@ class ErrorCode
     public static $IllegalBuffer = -41003;
     public static $DecodeBase64Error = -41004;
 }
-
-?>
\ No newline at end of file
diff --git a/src/wxBizDataCrypt/wxBizDataCrypt.php b/src/wxBizDataCrypt/wxBizDataCrypt.php
index 3214c18..449a1f9 100644
--- a/src/wxBizDataCrypt/wxBizDataCrypt.php
+++ b/src/wxBizDataCrypt/wxBizDataCrypt.php
@@ -20,7 +20,7 @@ class WXBizDataCrypt
      * @param $sessionKey string 用户在小程序登录后获取的会话密钥
      * @param $appid string 小程序的appid
      */
-    public function __construct( $appid, $sessionKey)
+    public function __construct($appid, $sessionKey)
     {
         $this->sessionKey = $sessionKey;
         $this->appid = $appid;
@@ -35,35 +35,31 @@ public function __construct( $appid, $sessionKey)
      *
      * @return int 成功0，失败返回对应的错误码
      */
-    public function decryptData( $encryptedData, $iv, &$data )
+    public function decryptData($encryptedData, $iv, &$data)
     {
         if (strlen($this->sessionKey) != 24) {
             return ErrorCode::$IllegalAesKey;
         }
-        $aesKey=base64_decode($this->sessionKey);
+        $aesKey = base64_decode($this->sessionKey);
 
 
         if (strlen($iv) != 24) {
             return ErrorCode::$IllegalIv;
         }
-        $aesIV=base64_decode($iv);
+        $aesIV = base64_decode($iv);
 
-        $aesCipher=base64_decode($encryptedData);
+        $aesCipher = base64_decode($encryptedData);
 
-        $result=openssl_decrypt( $aesCipher, "AES-128-CBC", $aesKey, 1, $aesIV);
+        $result = openssl_decrypt($aesCipher, "AES-128-CBC", $aesKey, 1, $aesIV);
 
-        $dataObj=json_decode( $result );
-        if( $dataObj  == NULL )
-        {
+        $dataObj = json_decode($result);
+        if ($dataObj  == NULL) {
             return ErrorCode::$IllegalBuffer;
         }
-        if( $dataObj->watermark->appid != $this->appid )
-        {
+        if ($dataObj->watermark->appid != $this->appid) {
             return ErrorCode::$IllegalBuffer;
         }
         $data = $result;
         return ErrorCode::$OK;
     }
-
 }
-
