多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
**一.crypt加密技术** 1.函数声明 ``` crypt ( string $str [, string $salt ] ) : string ``` 2.代码例子 ``` $hash = crypt('123',mt_rand().'-'.time()); ```   **二.数据加密和验证实例** // 用户注册 ``` $hash = crypt('123',mt_rand().'-'.time()); // 用户登录验证 if(hash_equals($hash, crypt('123', $hash))) { echo 'pass yes'; }else{ echo 'pass no'; } ```   **三.官方推荐password_hash加密技术** #建议用password_hash来代替crypt技术 #代码实例 ``` // 用户注册 $hash=password_hash('123',PASSWORD_DEFAULT); // 用户登录验证 if (password_verify('123', $hash)) { echo 'pass yes'; } else { echo 'pass no'; } ```