4 releases

0.2.0 Jun 19, 2023
0.1.2 Jun 12, 2023
0.1.1 Jun 12, 2023
0.1.0 Jun 9, 2023

#163 in Finance


Used in ivms101

MIT license

26KB
355 lines

Legal Entity Identifier Rust library

Crates.io Documentation

leim is a Rust library for working with Legal Entity Identifiers (LEIs) as defined in ISO 17442-1:2020.

Example

fn main() {
    use leim as lei;
    assert!(lei::LEI::try_from("2594007XIACKNMUAW223").is_ok());
    assert_eq!(
        lei::LEI::try_from("2594007XIACKNMUAW222"),
        Err(lei::Error::InvalidChecksum)
    );
}

Usage

Add leim to your Cargo.toml:

cargo add leim

Alternative crates

lei is another crate for working with LEIs.

Authors

This crate is developed and maintained by 21 Analytics.

License

This project is licensed under the MIT license.


lib.rs:

Rust LEI Library

This crate provides functionality to work with Legal Entity Identifiers (LEIs):

use leim as lei;
assert!(lei::LEI::try_from("2594007XIACKNMUAW223").is_ok());
assert_eq!(
    lei::LEI::try_from("2594007XIACKNMUAW222"),
    Err(lei::Error::InvalidChecksum)
);

Dependencies

~0.6–9MB
~96K SLoC