Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ulikunitz/damm
Golang package for computing a decimal check digit
https://github.com/ulikunitz/damm
Last synced: 11 days ago
JSON representation
Golang package for computing a decimal check digit
- Host: GitHub
- URL: https://github.com/ulikunitz/damm
- Owner: ulikunitz
- License: bsd-2-clause
- Created: 2015-01-02T22:40:19.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2020-12-31T14:16:41.000Z (about 4 years ago)
- Last Synced: 2024-12-03T16:56:08.074Z (2 months ago)
- Language: Go
- Homepage:
- Size: 4.88 KB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Package damm
The Go language package damm computes a check digit for a string of
decimal digits. It uses an algorithm proposed by H. Michael Damm in
2004.## Examples
The function CheckDigit computes and returns it as string.
c, err := CheckDigit("12345678901")
The argument must contain only decimal digits. Otherwise an error is
reported.The function Validate verifies digits with the check digit appended.
ok := Validate("123456789018")
The function returns true if the argument contains only decimal digits and
the appended check digit is correct.## Algorithm
More information about the algorithm can be found in Wikipedia.
http://en.wikipedia.org/wiki/Damm_algorithm