isbn

package module
v0.0.0-...-e6388fb Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2015 License: BSD-3-Clause Imports: 2 Imported by: 5

README

isbn

GoDoc Build Status

Package isbn provides functions to validate ISBN strings, calculate ISBN check digits and convert ISBN-10 to ISBN-13.

License

BSD licensed. See the LICENSE file for details.

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

func CheckDigit10(isbn10 string) (string, error)

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

func CheckDigit13(isbn13 string) (string, error)

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

func To13(isbn10 string) (string, error)

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

func Validate(isbn string) bool

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

func Validate10(isbn10 string) bool

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

func Validate13(isbn13 string) bool

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.

Jump to

Keyboard shortcuts

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