This file contains hidden or 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
| <?php | |
| DEFAULT_KEY = 'abcdefgh'; | |
| // $string 明文 或 密文 | |
| // $operation: decode =》 解密,其他是加密 | |
| // $key: 秘钥 | |
| // $expiry: 有效期 | |
| function authcode($string, $operation = 'DECODE', $key = '', $expiry = 0) { | |
| // 动态密钥长度,相同的明文会生成不同密文就是艺考动态密钥 (初始化向量 IV) |