定制 srph/luhn 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

srph/luhn

最新稳定版本:v0.1.0

Composer 安装命令:

composer require srph/luhn

包简介

An implementation of Luhn algorithm (aka mod-10 algorithm) in PHP.

README 文档

README

An implementation of Luhn algorithm (aka mod-10 algorithm) to validate (verify the checksum of) credit card numbers in PHP.

* This was written to try out PHPUnit, but feel free to use it for anything as long as the MIT License permits.

Installation

To install this library, simply run composer require in your project's root directory:

$ composer require srph/luhn

Usage

This library is very easy to use! Our function only accepts one string argument and returns a boolean.

<?php
/**
 * SRPH\Luhn\luhn(<string>);
 */
SRPH\Luhn\luhn('79927398712') => true
?>

For PHP >=v5.6, you can use the use function (aka import function) syntax:

<?php
use function SRPH\Luhn\luhn;

echo luhn('79927398712') // => true
?>

Contribution

Feel free to submit any inquiry, question, issue or pull-request!

Building

* For contributors or for learning purposes only.

Requirements:

First, clone the repository, and then install the development dependencies.

$ git clone https://github.com/srph/luhn.php.git && cd luhn.php
$ composer install

You're good to go.

Automation

# ensure that you are in the root directory of the project
$ phpunit # run tests

Acknowledgement

php-luhn © 2015+, Kier Borromeo (srph). Released under the MIT License.

srph.github.io  ·  GitHub @srph  ·  Twitter @_srph

统计信息

  • 总下载量: 18
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-03-20