Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sunaoka/damm
A PHP library that calculates and verifies the check digit using the Damm algorithm.
https://github.com/sunaoka/damm
checkdigit damm
Last synced: about 2 months ago
JSON representation
A PHP library that calculates and verifies the check digit using the Damm algorithm.
- Host: GitHub
- URL: https://github.com/sunaoka/damm
- Owner: sunaoka
- Created: 2024-10-22T06:52:40.000Z (2 months ago)
- Default Branch: develop
- Last Pushed: 2024-10-30T04:27:04.000Z (about 2 months ago)
- Last Synced: 2024-10-30T06:54:18.425Z (about 2 months ago)
- Topics: checkdigit, damm
- Language: PHP
- Homepage: https://packagist.org/packages/sunaoka/damm
- Size: 58.6 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Damm algorithm for PHP
[![Latest](https://poser.pugx.org/sunaoka/damm/v)](https://packagist.org/packages/sunaoka/damm)
[![License](https://poser.pugx.org/sunaoka/damm/license)](https://packagist.org/packages/sunaoka/damm)
[![PHP](https://img.shields.io/packagist/php-v/sunaoka/damm)](composer.json)
[![Test](https://github.com/sunaoka/damm/actions/workflows/test.yml/badge.svg)](https://github.com/sunaoka/damm/actions/workflows/test.yml)
[![codecov](https://codecov.io/gh/sunaoka/damm/branch/develop/graph/badge.svg)](https://codecov.io/gh/sunaoka/damm)---
A PHP library that calculates and verifies the check digit using the [Damm algorithm](https://en.wikipedia.org/wiki/Damm_algorithm).
Quasigroups are supported from order 3 to order 64 as well as order 10.
## Installation
```bash
composer require sunaoka/damm
```## Usage
### Quasigroup of order 10
```php
calculate('572');
// => 4var_dump($damm->validate('5724'));
// => bool(true)
```### Quasigroup of order 62
```php
calculate('4MTYDKH0S0E');
// => Dvar_dump($damm->validate('4MTYDKH0S0ED'));
// => bool(true)
```