Skip to content

Instantly share code, notes, and snippets.

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