Skip to content

Commit

Permalink
整理文档
Browse files Browse the repository at this point in the history
  • Loading branch information
cmpan committed Jun 26, 2017
1 parent c6b64b3 commit e832cd2
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Windwork 加密解密组件
可逆加密算法组件封装,目前支持AzDG、XxTea算法。

```
// useage:
// usage:
$key = '秘钥';
$txt = '明文~';
Expand All @@ -26,7 +26,7 @@ $cfg = [
$crypt = $cfg['class']($cfg);
// 4、在Windwork框架中使用
$crypt = crypt();
$crypt = \wfCrypt();
```

6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
"XXTea",
"AzDG"
],
"version" : "1.0.3",
"version" : "1.0.4",
"time" : "2017-06-26 16:30:00",
"require" : {
"php" : ">=5.5.0"
},
Expand All @@ -23,6 +24,5 @@
"name" : "Windwork Community",
"homepage" : "http://windwork.org"
}
],
"minimum-stability" : "alpha"
]
}
6 changes: 2 additions & 4 deletions lib/strategy/Xxtea.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
*/
namespace wf\crypt\strategy;

use \wf\crypt\Exception;

/**
* 基于xxtea加密算法实现
*
Expand Down Expand Up @@ -39,7 +37,7 @@ public function encrypt($str, $key)
}

if (!$key || !is_string($key)) {
throw new Exception('[wf\\crypt\\Xxtea::encrypt] param 2 ($key) is required.');
throw new \wf\crypt\Exception('[wf\\crypt\\Xxtea::encrypt] param 2 ($key) is required.');
}

$v = $this->str2long($str, true);
Expand Down Expand Up @@ -83,7 +81,7 @@ public function decrypt($str, $key)
}

if (!$key || !is_string($key)) {
throw new Exception('[wf\\crypt\\Xxtea::decrypt] param 2 ($key) is required.');
throw new \wf\crypt\Exception('[wf\\crypt\\Xxtea::decrypt] param 2 ($key) is required.');
}
$v = $this->str2long($str, false);
$k = $this->str2long($key, false);
Expand Down

0 comments on commit e832cd2

Please sign in to comment.