#identifier

sedol

A crate to validate SEDOLs

1 unstable release

0.1.0 May 18, 2022

#148 in #identifier

Download history 41/week @ 2024-07-27 22/week @ 2024-08-03 50/week @ 2024-08-10 4/week @ 2024-08-17 3/week @ 2024-08-31 12/week @ 2024-09-07 5/week @ 2024-09-21 29/week @ 2024-09-28 9/week @ 2024-10-05 60/week @ 2024-10-12 41/week @ 2024-10-19 124/week @ 2024-10-26 22/week @ 2024-11-02 33/week @ 2024-11-09

220 downloads per month

MIT/Apache

10KB
174 lines

Crates.io Workflow Status

sedol

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));

Current version: 0.1.0

License: MIT OR Apache-2.0

No runtime deps