php可以逆转的加密类示例
内容摘要
这篇文章主要为大家详细介绍了php可以逆转的加密类示例,具有一定的参考价值,可以用来参考一下。
对此感兴趣的朋友,看看idc笔记做的技术笔记。经测试代码如下:
/**
* 加密类
对此感兴趣的朋友,看看idc笔记做的技术笔记。经测试代码如下:
/**
* 加密类
文章正文
这篇文章主要为大家详细介绍了php可以逆转的加密类示例,具有一定的参考价值,可以用来参考一下。
对此感兴趣的朋友,看看idc笔记做的技术笔记。经测试代码如下:1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | <code class = "php" > /** * 加密类 * * @param * @author php教程 www.idcnote.com **/ class encryptCalss { var $key =12; function encode( $txt ){ for ( $i =0; $i < strlen ( $txt ); $i ++){ $txt [ $i ]= chr (ord( $txt [ $i ])+ $this ->key); } return $txt =urlencode( base64_encode (urlencode( $txt ))); } function decode( $txt ){ $txt =urldecode( base64_decode ( $txt )); for ( $i =0; $i < strlen ( $txt ); $i ++){ $txt [ $i ]= chr (ord( $txt [ $i ])- $this ->key); } return $txt ; } }</code> |
注:关于php可以逆转的加密类示例的内容就先介绍到这里,更多相关文章的可以留意
代码注释