Skip to content

Latest commit

 

History

History
36 lines (20 loc) · 623 Bytes

File metadata and controls

36 lines (20 loc) · 623 Bytes

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).