PHP generates two-dimensional code: Dcode

Source: Internet
Author: User
A QR Code encoder-based PHP extension of the generation of two-dimensional codes, while the implementation of the Discuz forum system inside the Authcode function, compared to PHP version faster, generated tens of thousands of two-dimensional code seconds seconds. If you use the Discuz forum, you need to have this performance improvement, then the extension is a good choice.

Dependency: php5.4+ libpng

Example code:

Dcode::encrypt ($src, $key = "shit", $ckeylength = 8, $expire = 0);D code::d ecrypt ($src, $key = "This is shit", $cke Ylength = 8); /** * Dcode::qrcode ($str, $version = 0, $level = qr_eclevel_l, $mode = Qr_mode_kanji, $casesensitive = 0); * @param $str; * @param $version = 0;* @param $level = qr_eclevel_l;* @param $model = qr_mode_kanji;* @param $casesensitive = 0;* @return S tring*/$filecontent = Dcode::qrcode ("HELLO"), File_put_contents ("Test.png", $filecontent); /*** dcode::qrcode8bit ($str, $version = 0, $level = qr_eclevel_l); * @param $str; * @param $version = 0;* @param $level = QR _eclevel_l;* @return string*/$filecontent = dcode::qrcode8bit ("HELLO World") file_put_contents ("Test1.png", $ Filecontent); /*** Dcode::qrcodedata ($sizeof, $data, $version = 0, $level = qr_eclevel_l); * @param $sizeof * @param $data * @param $versio n = 0;* @param $level = qr_eclevel_l;* @return string*/$filecontent = Dcode::qrcodedata (strlen ("Hello World"), "Hello Worl D "); File_put_contents (" Test2.png ", $filecOntent); Dcode_encrypt ($src, $key = "This was shit", $ckeylength = 8, $expire = 0);d code_decrypt ($src, $key = "This is shit", $ckeyl Ength = 8); $filecontent = Dcode_qrcode ("HELLO"); File_put_contents ("Test.png", $filecontent); $filecontent = Dcode_qrcode8bit ("HELLO 8bit"); File_put_contents ("Test1.png", $filecontent); $filecontent = Dcode_qrcodedata (strlen ("Hello 8bit"), "Hello 8bit"), File_put_contents ("Test2.png", $filecontent);

Project home:http://www.open-open.com/lib/view/home/1441010675112

  • 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.