Crates.io | lei |
lib.rs | lei |
version | 0.2.5 |
source | src |
created_at | 2021-09-13 13:04:29.06747 |
updated_at | 2023-06-08 19:46:51.961906 |
description | Support for creating and validating Legal Entity Identifiers (LEIs) |
homepage | |
repository | https://github.com/gnp/lei-rs.git |
max_upload_size | |
id | 450543 |
size | 61,318 |
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:
Add this to your Cargo.toml
:
[dependencies]
lei = "0.2"
use lei;
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),
}
Licensed under either of
at your option.
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.