PHPackages                             choval/damm - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. choval/damm

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

choval/damm
===========

Damm algorithm functions, a check digit algorithm that detects single-digit errors and adjacent transposition errors

v0.1.1(5y ago)21.7k↓38.1%[1 PRs](https://github.com/choval/damm/pulls)1MITPHPCI passing

Since Aug 16Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/choval/damm)[ Packagist](https://packagist.org/packages/choval/damm)[ RSS](/packages/choval-damm/feed)WikiDiscussions master Synced 2d ago

READMEChangelog (2)Dependencies (1)Versions (5)Used By (1)

Choval/damm
===========

[](#chovaldamm)

**Damm algorithm** functions.

> In error detection, the Damm algorithm is a check digit algorithm that detects all single-digit errors and adjacent transposition errors. It was presented by H. Michael Damm in 2004.
>
> \-- [Wikipedia](https://en.wikipedia.org/wiki/Damm_algorithm)

Install
-------

[](#install)

```
composer require choval/damm

```

Usage
-----

[](#usage)

```
damm_digit(string $number) : int
damm_valid(string $number[, string $digit]) : bool
```

Both functions take a string as parameter to allow numbers larger than `PHP_INT_MAX`.
They still have to be numeric.

Examples:

```
echo damm_digit(572);
// 4

echo damm_digit('572');
// 4

echo damm_digit('0000572');
// 4

echo damm_valid(572, 4);
// true

echo damm_valid(572, 3);
// false

echo damm_valid(5724);
// true

echo damm_valid('000005724');
// true
```

License
-------

[](#license)

MIT, see LICENSE

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance56

Moderate activity, may be stable

Popularity22

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~631 days

Total

2

Last Release

1882d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/f7e751254e7e7b319464bd6b51c51d9d2c5fedb4c2305ceaa580f9116cbc6a11?d=identicon)[choval](/maintainers/choval)

---

Top Contributors

[![choval](https://avatars.githubusercontent.com/u/794926?v=4)](https://github.com/choval "choval (7 commits)")

---

Tags

check-digitcheckdigitdammdamm-algorithmphp

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/choval-damm/health.svg)

```
[![Health](https://phpackages.com/badges/choval-damm/health.svg)](https://phpackages.com/packages/choval-damm)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
