Crates.io | sedol |
lib.rs | sedol |
version | 0.1.0 |
source | src |
created_at | 2022-05-18 13:46:06.17887 |
updated_at | 2022-05-18 13:46:06.17887 |
description | A crate to validate SEDOLs |
homepage | |
repository | https://github.com/truls-p/sedol |
max_upload_size | |
id | 588950 |
size | 22,793 |
SEDOL
Crate to validate SEDOLs.
https://en.wikipedia.org/wiki/SEDOL
https://www.lseg.com/markets-products-and-services/data-analytics/data-solutions/sedol/documentation
let sedol_string = "BD9MZZ7";
match sedol::validate(sedol_string) {
Ok(s) => println!("SEDOL validated: {}", s),
Err(e) => eprint!("{}", e),
}
let invalid_sedol_string = "BD9MZZ6";
match sedol::validate(invalid_sedol_string) {
Ok(s) => println!("SEDOL validated: {}", s),
Err(e) => eprintln!("{}", e),
}
let unclean_sedol_string = " BD9-MZ-Z7?";
match sedol::validate(&sedol::clean(unclean_sedol_string)) {
Ok(s) => println!("SEDOL validated: {}", s),
Err(e) => eprintln!("{}", e),
}
let sedol_6_string = "BD9MZZ";
println!("SEDOL with calculated check digit: {}{}", sedol_6_string, sedol::calc_check_digit(sedol_6_string));
Current version: 0.1.0
License: MIT OR Apache-2.0