What does binary security mean?

Source: Internet
Author: User
Some methods in PHP are described as "binary Security ". What does this mean? Some methods in PHP are described as "binary Security ". What does this mean?

Reply content:

Some methods in PHP are described as "binary Security ". What does this mean?

This means that the function can still operate normally when its parameters include binary data.

For example, if strlen has \ 0 in the input data, it does not stop here. So it can be said that it is binary safe.

I also saw this statement in the redis database introduction. I think the binary security should be:
Only the binary string is concerned, and the specific format is not concerned. Only the binary data is strictly accessed.
Sometimes opening a file in an incorrect format will lead to irreversible damage to the file, while binary security will avoid such damage.

For example, the strcoll function is non-binary secure. Strcmp is binary secure.

Their differences are:

$ String1 = "Hello"; $ string2 = "Hello \ x00Hello"; echo strcoll ($ string1, $ string2); // returns 0 because it is not binary secure, equivalent echo strcmp ($ string1, $ string2); // return a negative number.

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.