verhoeff

package module
v0.0.0-...-967f831 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2021 License: Unlicense Imports: 1 Imported by: 0

README

zero-alloc verhoeff checksum algorithm

Go Report Card

Usage

import "github.com/jancajthaml-go/verhoeff"

ok := verhoeff.Validate("00123014764700968325")

digit, error := verhoeff.Digit("x")

signed := verhoeff.Generate("1")

Resources

Documentation

Overview

Information about the algorithm is available on Wikipedia

https://en.wikipedia.org/wiki/Verhoeff_algorithm

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Digit

func Digit(cc string) (int, error)

Digit returns verhoeff digit for given numeric string

func Generate

func Generate(cc string) (string, error)

Generate signs string with verhoeff digit

func Validate

func Validate(cc string) bool

Validate returns true if numeric string is signed with valid luhn digit

Types

This section is empty.

Jump to

Keyboard shortcuts

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