Skip to content

hypergeometric/damm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Damm check digit algorithm

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published