dam

damm

Damm check digit algorithm

Showing:

Popularity

Downloads/wk

51

Maintenance

No Maintenance Data Available

Package

Dependencies

0

Size (min+gzip)

0.4KB

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

damm

A JavaScript implementation of the Damm algorithm, a check digit algorithm created by H. Michael Damm. It detects all single-digit errors and adjacent transposition errors (swapping adjacent numbers). For more information see the Wikipedia article which includes a description of the algorithm and links to the relevant papers.

Install

npm install damm

Example

var damm = require('damm');

damm.generate('572'); // '4'

damm.append('572'); // '5724'

damm.verify('5724'); // true

// Single-digit error
damm.verify('5734'); // false

// Adjacent transposition error
damm.verify('5274'); // false

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100