定制 chrsc/luhn-algorithm 二次开发

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

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

chrsc/luhn-algorithm

Composer 安装命令:

composer require chrsc/luhn-algorithm

包简介

Validate and create credit/bank/loyalty card numbers

README 文档

README

I created this as a utility class that will be used to validate card numbers, this works for credit card numbers, bank accounts, loyalty card numbers, and all other card numbers that follow the modulus 10 formula.

Other uses: Validate Canadian SIN / Greek SSN / Israel ID numbers, NPI numbers for American health care, IMEI numbers.

This could not have been created without Hans Peter Luhn's Algorithm.

Validate numbers

<?php
	$number = 123456;
	$luhn = new LuhnAlgorithm;
	if($luhn->validate($number)) {
		// number passes validation
	} else {
		// number does not pass validation
	}

Create numbers

<?php
	$luhn = new LuhnAlgorithm;
	$length = 16;
	$startswith = 4444;
	$cardnumber = $luhn->create($length, $startswith);
	// $cardnumber is now a valid card number that can be used or assigned

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-07-11

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固