#book

isbn

A library for handling ISBNs

2 unstable releases

0.2.0 Jan 22, 2019
0.1.0 Jun 19, 2017
Download history 24/week @ 2022-12-06 10/week @ 2022-12-13 25/week @ 2022-12-20 12/week @ 2022-12-27 11/week @ 2023-01-03 23/week @ 2023-01-10 17/week @ 2023-01-17 30/week @ 2023-01-24 22/week @ 2023-01-31 28/week @ 2023-02-07 31/week @ 2023-02-14 70/week @ 2023-02-21 17/week @ 2023-02-28 17/week @ 2023-03-07 50/week @ 2023-03-14 10/week @ 2023-03-21

97 downloads per month
Used in 2 crates

MIT license

22KB
471 lines

isbn

Build Status

A library for handling International Standard Book Number, or ISBNs.


lib.rs:

A library for handling International Standard Book Number, or ISBNs.

Examples

use isbn::{Isbn10, Isbn13};

let isbn_10 = Isbn10::new(8, 9, 6, 6, 2, 6, 1, 2, 6, 4).unwrap();
assert_eq!(isbn_10.hyphenate().unwrap().as_str(), "89-6626-126-4");
assert_eq!(isbn_10.registration_group(), Ok("Korea, Republic"));
assert_eq!("89-6626-126-4".parse(), Ok(isbn_10));

let isbn_13 = Isbn13::new(9, 7, 8, 1, 4, 9, 2, 0, 6, 7, 6, 6, 5).unwrap();
assert_eq!(isbn_13.hyphenate().unwrap().as_str(), "978-1-4920-6766-5");
assert_eq!(isbn_13.registration_group(), Ok("English language"));
assert_eq!("978-1-4920-6766-5".parse(), Ok(isbn_13));

Dependencies

~155KB