承接 plasmaconduit/luhn 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

plasmaconduit/luhn

最新稳定版本:v0.1.0

Composer 安装命令:

composer require plasmaconduit/luhn

包简介

README 文档

README

Build Status

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

GitHub 信息

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

其他信息

  • 授权协议: Unknown
  • 更新时间: 2013-02-12