js与php加密、解密函数

php中加密、解密
用rawurlencode()对字符串加密,代替原始的urlencode():为了保证特殊字符,空格,回车,等操作的正确性
同时用rawurldecode()进行解码,代替urldecode(),同样理由
javascript中加密、解密
用encodeURIComponent()代替encodeURI(),加密
用decodeURIComponent()代替decodeURI(),解密

都是为了防止加密过程中对特殊字符的处理会出错的问题

posted @ 2013-12-17 11:31  樰梅  阅读(583)  评论(0编辑  收藏  举报