| Crates.io | codes-check-digits |
| lib.rs | codes-check-digits |
| version | 0.1.2 |
| created_at | 2022-12-22 23:35:49.002521+00 |
| updated_at | 2022-12-25 02:19:40.344953+00 |
| description | Common implementation of check digit algorithms |
| homepage | |
| repository | https://github.com/johnstonskj/rust-codes |
| max_upload_size | |
| id | 744174 |
| size | 38,113 |
This package contains implementations of various check digit specifications, including ISO/IEC 7064:2003 Information technology — Security techniques — Check character systems.
For notes on the design of the API, see the repository README.
use codes_check_digits::{luhn, Calculator};
let calculator = luhn::get_algorithm_instance();
assert!(calculator.is_valid("US0378331005"));
assert!(calculator.validate("US0378331005").is_ok());
assert_eq!(calculator.calculate("US037833100"), Ok(5));
gs1 - Adds the gs1 module containing algorithms for various codes such as
EAN, GTIN, GLN, and UPC.iso_7064 - Adds the iso_7064 module containing implementations of the
variants defined in ISO/IEC 7064:2003.luhn - Adds the luhn module containing an implementation of the Luhn Algorithm.sedol - Adds the sedol module containing an implementation of the algorithm
used in SEDOL numbers.Version 0.1.2
Version 0.1.1
Version 0.1.0
codes-common, codes-iso-6166,
codes-iso-17442, and codes-gs1-gln.TBD