What exactly does this JB code do?

Source: Internet
Author: User
What exactly does this JB code do?
$ln = $this->lengthIndicator($this->QR_MODE_NM, $this->version);$dif = $this->estimateBitsModeNum($run) + 4 + $ln+ $this->estimateBitsMode8(1)         // + 4 + l8- $this->estimateBitsMode8($run + 1); // - 4 - l8if ($dif > 0) {return $this->eat8();}function estimateBitsModeNum($size) {$w = (int)$size / 3;$bits = $w * 10;switch($size - $w * 3) {case 1: {$bits += 4;break;}case 2: {$bits += 7;break;}default: {break;}}return $bits;}function estimateBitsMode8($size) {return $size * 8;}function lengthIndicator($mode, $version) {if ($mode == $this->QR_MODE_ST) {return 0;}if ($version <= 9) {$l = 0;} elseif ($version <= 26) {$l = 1;} else {$l = 2;}return $this->lengthTableBits[$mode][$l];}$lengthTableBits = array(array(10, 12, 14),array( 9, 11, 13),array( 8, 16, 16),array( 8, 10, 12));


Reply to discussion (solution)

Who knows what you're doing?

The code is incomplete, so I cannot see what the JB code is trying to do.

What are you doing? answer points!

Come on, check out.

I cannot understand it!

Generate a QR code.

Generate a QR code.

I have met experts. Explanations

This code is too short. it seems to be a QR code.

This code is too short. it seems to be a QR code.

Why eat12, 14.

I don't know how the QR code works. can I understand the code?
Numeric mode Numeric encoding, from 0 to 9. If the number of numbers to be encoded is not a multiple of 3, the remaining 1 or 2 digits will be converted to 4 or 7 bits, the other three digits are compiled into 10, 12, and 14 bits corresponding to your estimateBitsModeNum.
Number of digits encoded in different versions:
Corresponding to your lengthIndicator

I do not understand, help you find the information: http://coolshell.cn/articles/10590.html#jtss-tsina

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.