PHP Learning Series (1)--String processing function (3), PHP function 11, CRC32 () function computes the crc32 polynomial of a string. A 32-bit cyclic redundancy check code polynomial that generates a string parameter. This function can be used to
Note: This article reprinted http://www.manongjc.com/article/499.html
The PHP crc32 function is used to generate a string of 32-bit cyclic redundancy check code polynomial. This is typically used to check the integrity of the data being transmitted.
Php crc32 calculates the 32-bit CRC (cyclic redundancy check) and crc32crc of the string.
Note: This article reprinted http://www.manongjc.com/article/499.html
The php crc32 function is used to generate a 32-bit Cyclic Redundancy checkcode
Note: This article reprinted http://www.manongjc.com/article/499.htmlThe PHP crc32 function is used to generate a string of 32-bit cyclic redundancy check code polynomial. This is typically used to check the integrity of the data being transmitted.
This article was reproduced from: http://blog.163.com/yucheng_xiao/blog/static/76600192201393092918776/First, the basic principleThe CRC test principle is actually the addition of an R-bit binary test code (sequence) after a P-bit binary data
Instance
Results of output CRC32 ():
Definition and usage
The CRC32 () function computes a 32-bit CRC (cyclic redundancy check) for a string.
This function can be used to verify the integrity of the data.
Tip: To ensure that you can get the correct
These days in the study of CRC32 calculation process, see the principle of CRC algorithm, but also see a lot of code implemented by the shift method, but the results are calculated with the calibration tool is inconsistent.Toss for a long time,
When a Web server communicates with an app server, it often uses different languages on both ends. For example, this time I met PHP and C.PHP as a high-level language, a variety of convenient library functions are readily accessible, in the PHP crc32
The following is a CRC32 computingCodeAccording to my tests, the results are correct. I hope to help you and avoid detours !!!
Note !!!!The generated polynomial is: Poly = 0x4c11db7;
Class iso_13818_crc32 {Public:Iso_13818_crc32 ();Void Update
CRC16 Implementation CodeIdea: Take a character (8bit), check the character bit by digit, if it is 1,crc^crc_mul, and if the original CRC highest bit is 1, then crc^crc_mul the left 1 bits, otherwise it just moves left one bit. After calculating one
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.