Home  >  Article  >  Backend Development  >  php校验数据有关问题

php校验数据有关问题

WBOY
WBOYOriginal
2016-06-13 10:10:24783browse

php校验数据问题

PHP code
$str3 = $str1.$str2;//现在只知道$str1的校验值和 $str2的内容还有校验值//用crc32校验怎么算出来$str3的校验值 


------解决方案--------------------
没办法,从数据特征值、循环冗余校验码是没办法逆运算原数据的。。128位、512或者32位不可能表示无穷多的数据
PHP code
var_dump(crc32("86821"), crc32("14740600"));
------解决方案--------------------
可能的!

CRC 算法可参考 http://blog.csdn.net/sparkliang/article/details/5671510 说的比较清楚

你可将 $str1的校验值 作为基值,继续对 $str2的内容 进行运算
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn