Swiftpack.co - jens-andre/isbn as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by jens-andre.
jens-andre/isbn 1.2.1
Represents a International Standard Book Number
⭐️ 0
🕓 1 week ago
macOS
.package(url: "https://github.com/jens-andre/isbn.git", from: "1.2.1")

ISBN

Represents a International Standard Book Number, the unique identification of books and other independent publications with editorial content.

Declaration

struct ISBN

Initializers

init?(Int)

Create a ISBN with a given GTIN representation; returns nil if the ISBN is not valid

init?(String)

Create a ISBN with a given string representation; returns nil if the ISBN is not valid

Instance Properties

let checkDigit: Int

The check digit element of the ISBN

let group: Int

The group number element of the ISBN

let groupName: String

The registration group name of the ISBN

let gtin: Int

The Global Trade Item Number

let isbnString: String

The string representation of the ISBN

let prefix: Int

The prefix element of the ISBN; either 978 or 979

let publication: Int

The publication number element of the ISBN

let registrant: Int

The registrant number element of the ISBN

Type Methods

static func isValid(Int) -> Bool

Validates a given GTIN representation of a ISBN

static func isValid(String) -> Bool

Validates a given string representation of a ISBN

Relationships

Conforms to

  • Swift.CustomStringConvertible
  • Swift.Decodable
  • Swift.Encodable
  • Swift.Equatable

License

MIT License.

Copyright (c) 2019 jens-andre

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

GitHub

link
Stars: 0
Last commit: 1 week ago
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.

Release Notes

1 week ago

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics