plasmaconduit/luhn
最新稳定版本:v0.1.0
Composer 安装命令:
composer require plasmaconduit/luhn
包简介
README 文档
README
An implementation of the Luhn algorithm for verifying the checksum of credit card numbers.
<?php use PlasmaConduit\Luhn; echo "The '4012888888881881' CC# is "; if (Luhn::validate("4012888888881881")) { echo "valid\n"; } else { echo "invalid\n"; }
Public Interface
namespace PlasmaConduit; class Luhn { /** * Takes a number and calculates the Luhn checksum of it * * @param {Int} $number - The number to calculate the checksum for * @return {Int} - The computed checksum */ static public function checksum($number); /** * Given an incomplete Luhn this calculates the check digit * * @param {Int} $number - The incomplete number to derive the check digit * @return {Int} - The derived check digit */ static public function getCheckDigit($number); /** * Given a complete Luhn this function returns true if it's valid * * @param {Int} $number - The Luhn to validate * @return {Boolean} - True on valid false otherwise */ static public function validate($number); }
统计信息
- 总下载量: 3.41k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 4
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Unknown
- 更新时间: 2013-02-12