Erasin 4 years ago
parent
commit
a409aba79c
6 changed files with 128 additions and 14 deletions
  1. 85 0
      src/Dy/Barcode.php
  2. 20 0
      src/Dy/Crypt.php
  3. 0 12
      src/Dy/Image.php
  4. 13 1
      src/Dy/Otp.php
  5. 1 1
      src/Dy/Shell.php
  6. 9 0
      src/Dy/funs.php

+ 85 - 0
src/Dy/Barcode.php

@@ -0,0 +1,85 @@
+<?php
+
+namespace Dy;
+
+/**
+ * Barcode 条形码
+ */
+class Barcode
+{
+
+    /**
+     * QR 生成
+     *
+     * @param string $content 内容
+     * @param string $dest 存储位置
+     * @param integer $height 高度
+     * @return void|bool|ErrorException
+     */
+    public static function qr(string $content, string $dest, int $height=128)
+    { 
+    }
+
+    /**
+     * code128 a 规范
+     * CODE128A:标准数字和大写字母,控制符,特殊字符
+     *
+     * @param string $str 内容
+     * @param string $dest 图片存储地址,PNG类型.
+     * @param integer $height 条码高度
+     * @return void|Exception
+     */
+    public static function code128a(string $str, string $dest, int $height=80)
+    {
+    }
+
+    /**
+     * code128 b 规范
+     * CODE128B:标准数字和大写字母,小写字母,特殊字符
+     *
+     * @param string $str 内容
+     * @param string $dest 图片存储地址,PNG类型.
+     * @param integer $height 条码高度
+     * @return void|Exception
+     */
+    public static function code128b(string $str, string $dest, int $height=80)
+    {
+    }
+
+    /**
+     * code128 c 规范
+     * CODE128C:[00]-[99]的数字对集合,共100个
+     *
+     * @param string $str 内容
+     * @param string $dest 图片存储地址,PNG类型.
+     * @param integer $height 条码高度
+     * @return void|Exception
+     */
+    public static function code128c(string $str, string $dest, int $height=80)
+    {
+    }
+
+    /**
+     * code39 规范
+     * 数字和字母支持
+     * @param string $str 内容
+     * @param string $dest 图片存储地址,PNG类型.
+     * @param integer $height 条码高度
+     * @return void|Exception
+     */
+    public static function code39(string $str, string $dest, int $height=80)
+    {
+    }
+
+    /**
+     * EAN 13 规范
+     *
+     * @param string $str 内容
+     * @param string $dest 图片存储地址,PNG类型.
+     * @param integer $height 条码高度
+     * @return void|Exception
+     */
+    public static function ean13(string $str, string $dest, int $height=80)
+    {
+    }
+}

+ 20 - 0
src/Dy/Crypt.php

@@ -13,4 +13,24 @@ class Crypt
     public static function md5(string $str)
     {
     }
+
+    /**
+     * base32_enocde
+     *
+     * @param string $str
+     * @return string
+     */
+    public static function base32_encode(string $str)
+    {
+    }
+
+    /**
+     * base32_deocde
+     *
+     * @param string $str
+     * @return string
+     */
+    public static function base32_decode(string $str)
+    {
+    }
 }

+ 0 - 12
src/Dy/Image.php

@@ -47,18 +47,6 @@ class Image
     }
 
     /**
-     * QR 生成
-     *
-     * @param string $content
-     * @param string $dest
-     * @param integer $width
-     * @return void|bool|ErrorException
-     */
-    public static function qr(string $content, string $dest, int $width)
-    {
-    }
-
-    /**
      * 头像生成
      *
      * @param string $dest

+ 13 - 1
src/Dy/Otp.php

@@ -7,7 +7,7 @@ class Otp
     /**
      * 新建生成器
      *
-     * @param string $secret 密钥
+     * @param string $secret 密钥 Dy\Crypt::base32_encode
      * @param int $digits  长度
      * @param int $preiod  变动间隔 htop时候有效 建议60
      *
@@ -37,4 +37,16 @@ class Otp
     {
         // code...
     }
+
+    /**
+     * 发行者:用户名
+     *
+     * 格式为 "issuer:username",获取地址后可以生成二维码提供给client
+     *
+     * @param String $issuer
+     * @return String
+     */
+    public function url(String $issuer)
+    {
+    }
 }

+ 1 - 1
src/Dy/Shell.php

@@ -8,7 +8,7 @@ class Shell
      * shell
      *
      * @param string $cmd 命令
-     * @param string $str 参数
+     * @param string $flags 参数
      *
      * @return bool
      */

+ 9 - 0
src/Dy/funs.php

@@ -0,0 +1,9 @@
+<?php 
+/**
+ * 版本号
+ *
+ * @return string
+ */
+function dyutils_version()
+{
+}