Documentation
¶
Overview ¶
Package iso7064 provides check-digit validation using the ISO 7064 MOD 11-10 algorithm for 9-digit numeric identifiers.
Mod11_10 returns both the validation result and an error for malformed input. IsValidMod11_10 is a convenience wrapper that returns false on any error.
Both functions accept string or int64 via a generic type parameter. When using int64, leading zeros are not preserved; if your identifier can have leading zeros, pass it as a string.
Example:
valid := iso7064.IsValidMod11_10("123456788")
valid, err := iso7064.Mod11_10("123456788")
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsValidMod11_10 ¶
IsValidMod11_10 checks if the ISO 7064 MOD 11-10 check digit is valid. Returns false for invalid input or failed validation.
Example:
iso7064.IsValidMod11_10("123456788") // true
func Mod11_10 ¶
Mod11_10 validates an ISO 7064 MOD 11-10 check digit for a 9-digit number. Returns true if valid, false otherwise. Returns error if input is not a valid 9-digit number.
Note: When using int64 input, leading zeros are not preserved. If your identifier can have leading zeros, pass it as a string.
Example:
valid, err := iso7064.Mod11_10("123456788") // true, nil
Types ¶
This section is empty.