lei

An LEI type for working with validated Committee on Legal Entity Identifiers (LEIs) as defined in ISO 17442:2020 "Financial services — Legal entity identifier (LEI) — Part 1: Assignment".

This crate is part of the Financial Identifiers series:

Usage

Add this to your Cargo.toml:

toml [dependencies] lei = "0.1"

Example

rust use lei; fn main() -> () { let lei_string = "YZ83GD8L7GG84979J516"; // Example from Section A.1 of The Standard match lei::parse_strict(lei_string) { Ok(lei) => { println!("Parsed LEI: {}", lei.to_string()); // "YZ83GD8L7GG84979J516" println!(" LOU ID: {}", lei.lou_id()); // "YZ83" println!(" Entity ID: {}", lei.entity_id()); // "GD8L7GG84979J5" println!(" Check digits: {}", lei.check_digits()); // "16" } Err(err) => panic!("Unable to parse LEI {}: {}", lei_string, err), } }

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.