/bban_gen

BBAN generator

Primary LanguageGoMIT LicenseMIT

BBAN generator

Simple BBAN generator & validator

Go Report Card GoDoc Build Status Coverage Status

Installation

go get github.com/m1ome/bban_gen

Usage

package main

import (
    "fmt"

    bban "github.com/m1ome/bban_gen"
)

func main() {
	account := bban.Random("040577", "13439317554524", bban.DoubleMod)
	fmt.Printf("Generated account: %s\n", account)

	next := bban.Next("040577", account, "13439317554524", bban.DoubleMod)
	fmt.Printf("Next account: %s\n", next)

	fmt.Printf("Validity passing: %v\n", bban.Validate("040577", next, "13439317554524", bban.DoubleMod))
}