Google PR Query Interface checksum new algorithm 1th/2 page _php instance

Source: Internet
Author: User
Tags arithmetic php script
Instead, a large section of "in your emails, please send us the entire code displayed below" such as Google terms_of_service error message. It seems that the original interface has been invalidated.

But I installed in the Firefox toolbar extension Searchstatus still able to parse out the PR value of each page, find the Searchstatus of the plug-in package to see the source code, really is the use of a different verification code generation algorithm, in the original checksum after the generation, One more calculation is needed, and the correct ch parameter is obtained after the two calculus.

Then take the ready-made JS code to transform, the new PHP version of the Google PageRank query interface method came out. After the local test, who wants to upload to the server, and then there are the damned Terms_of_service error prompts. Checksum the calculation of the process to a step-by-step, found that after several right shifts, the local and server numbers are different. This is the idea that the server is a 64-bit machine, 32-bit system after the shift should be cut off bit is there to live well. Add a Trunkbitforce32bit method, the number of all arithmetic operations after the high shielding, is to deal with the 64-bit system redundant bit problem. The result is a 32-bit Linux environment run is not compatible, because PHP in the arithmetic processing overflow, will automatically try to convert int float. When a negative number overflows, this operation correctly preserves accuracy under windows, but there is a problem with Linux.

The following code:

$a =-4294967295;
echo Dechex ($a). " <br/>\n ";
if ($a < 0) $a + = 4294967296;
echo Dechex ($a). " <br/>\n ";

The first echo is able to correctly output the 32-bit complement of this negative number under Windows, while the maximum negative 0x80000000 that an int type can represent on a 32-bit Linux machine. Only by using a tricky way to offset the overflow by adding a large integer larger than the integer range to compensate for the excess, the 32-bit should be restored.

Using these unconventional means, finally concocted this updated version of the compatible linux32/linux64/windows Google PR value query interface PHP script implementation (including complete code).
Current 1/2 page 12 Next read the full text

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.