Damm is a small Go library which implements the Damm check digit algorithm.
go get github.com/umahmood/damm
cd $GOPATH/src/github.com/umahmood/damm
go test ./...
package main
import (
"fmt"
"github.com/umahmood/damm"
)
func main() {
c := damm.Calc(572) // c = 5724
fmt.Println(damm.Validate(c)) // output: true
}
See the LICENSE file for license rights and limitations (MIT).