lei 0.2.5

Support for creating and validating Legal Entity Identifiers (LEIs)
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use lei;
fn main() -> () {
    let lei_string = "YZ83GD8L7GG84979J516"; // Example from Section A.1 of The Standard
    match lei::parse(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),
    }
}