php 生成二维码 dcode

码农软件 · 软件分类 · 条形码/二维码 · 2019-10-07 23:42:36

软件介绍

一个基于QR Code encoder的生成二维码的php扩展,同时实现了Discuz论坛系统里面的authcode函数,相比php版本速度更快,生成几万个二维码秒秒钟。如果使用Discuz论坛,需要有这方面性能提升的,那么该扩展时不错的选择。

依赖: php5.4+ libpng

示例代码:

DCode::encrypt($src, $key = "THIS IS SHIT", $ckeylength = 8, $expire = 0);
DCode::decrypt($src, $key = "THIS IS SHIT", $ckeylength = 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 string
*/
$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 $version = 0;
* @param $level = QR_ECLEVEL_L;
* @return string
*/
$filecontent = DCode::qrcodedata(strlen("HELLO WORLD"), "HELLO WORLD");
file_put_contents("test2.png", $filecontent);

dcode_encrypt($src, $key = "THIS IS SHIT", $ckeylength = 8, $expire = 0);
dcode_decrypt($src, $key = "THIS IS SHIT", $ckeylength = 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);


本文地址:https://www.codercto.com/soft/d/16275.html

Introduction to Algorithms, 3rd Edition

Introduction to Algorithms, 3rd Edition

Thomas H. Cormen、Charles E. Leiserson、Ronald L. Rivest、Clifford Stein / The MIT Press / 2009-7-31 / USD 94.00

Some books on algorithms are rigorous but incomplete; others cover masses of material but lack rigor. Introduction to Algorithms uniquely combines rigor and comprehensiveness. The book covers a broad ......一起来看看 《Introduction to Algorithms, 3rd Edition》 这本书的介绍吧!

JS 压缩/解压工具
JS 压缩/解压工具

在线压缩/解压 JS 代码

随机密码生成器
随机密码生成器

多种字符组合密码

Base64 编码/解码
Base64 编码/解码

Base64 编码/解码