SkillAgentSearch skills...

Luhn

Luhn (Modulo 10 or mod 10 algorithm) for PHP

Install / Use

/learn @selective-php/Luhn
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

Luhn

Luhn (modulus 10 or mod 10 algorithm) for PHP

Latest Version on Packagist Software License Build Status Coverage Status Quality Score Total Downloads

Requirements

  • PHP 8.1+

Installation

composer require selective/luhn

Usage

Create a number

<?php

use Selective\Luhn\Luhn;

$luhn = new Luhn();

echo $luhn->create('7992739871'); // 3

Validate a number

<?php

use Selective\Luhn\Luhn;

$luhn = new Luhn();

$luhn->validate('79927398713'); // true
$luhn->validate('79927398710'); // false

License

  • MIT
View on GitHub
GitHub Stars10
CategoryDevelopment
Updated1mo ago
Forks5

Languages

PHP

Security Score

95/100

Audited on Feb 23, 2026

No findings