ryantxr/coupon-code
Composer 安装命令:
composer require ryantxr/coupon-code
包简介
Generates coupon codes.
README 文档
README
This is a flexible coupon code generator.
A 'Coupon Code' is made up of letters and numbers grouped into 4 character 'parts'. For example, a 3-part code might look like this:
1K7Q-CTFM-LMTC
Coupon Codes are random codes which are easy for the recipient to type accurately into a web form. An example application might be to print a code on a letter to a customer who would then enter the code as part of the registration process for web access to their account.
Installation
composer require ryantxr/coupon-code
Static Usage
\Ryantxr\CouponCode\Generator::generate(); // generate a code \Ryantxr\CouponCode\Generator::generate(true); // generate a lowercase code $bytes = random_bytes(16); \Ryantxr\CouponCode\Generator::generate(true, $bytes); // generate a lower case code and pass in the random bytes \Ryantxr\CouponCode\Generator::init(['numberOfSegments' => 5, 'segmentLength' => 4])->generateCode(); // generate a code
Use as an object
$codeGenerator = new \Ryantxr\CouponCode\Generator(); $codeGenerator = new \Ryantxr\CouponCode\Generator(['numberOfSegments' => 5, 'segmentLength' => 4]); $code = $codeGenerator->generateCode(); $code = $codeGenerator->generateCode(true); // generate a lowercase code $code = $codeGenerator->generateCode(true, $randomBytes); // generate a lowercase code, passing in the random bytes
See also
perl https://github.com/grantm/Algorithm-CouponCode
NodeJS https://www.npmjs.com/package/coupon-code
ryantxr/coupon-code 适用场景与选型建议
ryantxr/coupon-code 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 5 次下载、GitHub Stars 达 1, 最近一次更新时间为 2019 年 01 月 18 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「codes」 「coupon」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 ryantxr/coupon-code 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 ryantxr/coupon-code 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 ryantxr/coupon-code 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
ZipField is a form field for entering and validating postal codes in ATK14 applications
Coupon Error Message extension
Generate Apple Passbooks from your Symfony application
PHP library for using ANSI escape codes in the terminal
PHP Library for ZIP codes
Extension of Magento2 Sales Rule to allow multiple coupon usage.
统计信息
- 总下载量: 5
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 6
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: DBAD
- 更新时间: 2019-01-18