Documentation
¶
Overview ¶
Package isbn provides functions to validate ISBN strings, calculate ISBN check digits and convert ISBN-10 to ISBN-13.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckDigit10 ¶
CheckDigit10 returns the check digit for an ISBN-10.
The provided string must have a length of 9 or 10 and no formatting characters (spaces or hyphens). For a 10-length string, the last character (the digit) is ignored since that is what is being (re)calculated.
func CheckDigit13 ¶
CheckDigit13 returns the check digit for an ISBN-13.
The provided string must have a length of 12 or 13 and no formatting characters (spaces or hyphens). For a 13-length string, the last character (the digit) is ignored since that is what is being (re)calculated.
func To13 ¶
To13 converts an ISBN-10 to an ISBN-13.
The provided string must have a length of 9 or 10 and no formatting characters (spaces or hyphens).
func Validate ¶
Validate returns true if the provided string is a valid ISBN-10 or ISBN-13.
The provided string must have a length of 10 or 13 and no formatting characters (spaces or hyphens).
func Validate10 ¶
Validate10 returns true if the provided string is a valid ISBN-10.
The provided string must have a length of 10 and no formatting characters (spaces or hyphens).
func Validate13 ¶
Validate13 returns true if the provided string is a valid ISBN-13.
The provided string must have a length of 13 and no formatting characters (spaces or hyphens).
Types ¶
This section is empty.