esr

package module
v1.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 3, 2024 License: MIT Imports: 1 Imported by: 0

README

An implementation of Common check-digit mod11 algorithm

Go Report Card Coverage Status Build Status

Compatible with the ozzo-validation package.

Usage

import "github.com/kolkov/esr"

err := esr.Validate("639400")

signed := esr.Generate("1")

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrValueNotCommon = errors.New("esr: must be valid number by Common algorithm")

Functions

func Digit

func Digit(code string) int

Digit generate return the check digit

func Generate

func Generate(code string) string

Generate return the number with check digit

func Validate

func Validate(value interface{}) error

Validate check number is valid or not based on Common algorithm

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL