Expand description
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
Examples
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));
Enums
Enum representing reasons why a SEDOL string might be invalid
Functions
Calculate the check digits for the sedol
Remove all characters except is_ascii_alphabetic and is_ascii_digit
Check if the SEDOL is valid.