package
module
Version:
v0.0.0-...-d0fac6d
Opens a new window with list of versions in this module.
Published: Jun 11, 2016
License: MIT
Opens a new window with license information.
Imports: 0
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
¶
Damm Algorithm
Damm is a small Go library which implements the Damm check digit algorithm.
Installation
go get github.com/umahmood/damm
cd $GOPATH/src/github.com/umahmood/damm
go test ./...
Usage
package main
import (
"fmt"
"github.com/umahmood/damm"
)
func main() {
c := damm.Calc(572) // c = 5724
fmt.Println(damm.Validate(c)) // output: true
}
Documentation
http://godoc.org/github.com/umahmood/damm
License
See the LICENSE file for license rights and limitations (MIT).
Documentation
¶
Package damm implements the Damm check digit algorithm.
Example:
package main
import (
"fmt"
"github.com/umahmood/damm"
)
func main() {
c := damm.Calc(572)
fmt.Println(damm.Validate(c)) // output: true
}
Calc calculates the check digit of n and appends it as a trailing digit to n.
Validate n against the included trailing check digit.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.