1 unstable release

0.4.0 Mar 20, 2021

#25 in #international

Download history 40/week @ 2024-03-09 4/week @ 2024-03-16 46/week @ 2024-03-23 24/week @ 2024-03-30 10/week @ 2024-04-06 92/week @ 2024-04-13 25/week @ 2024-04-20 19/week @ 2024-04-27 20/week @ 2024-05-04 2/week @ 2024-05-11 5/week @ 2024-05-18 42/week @ 2024-05-25 94/week @ 2024-06-01 141/week @ 2024-06-08 101/week @ 2024-06-15 78/week @ 2024-06-22

425 downloads per month

MIT license

52KB
1K SLoC

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 isbn2::{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

~1–1.6MB
~27K SLoC