codes-iso-17442

Crates.iocodes-iso-17442
lib.rscodes-iso-17442
version0.1.3
sourcesrc
created_at2022-12-07 00:43:15.601865
updated_at2022-12-25 02:52:24.070501
descriptionThis package contains an implementation of the ISO 17442 Legal Entity Identifier (LEI) specification.
homepage
repositoryhttps://github.com/johnstonskj/rust-codes
max_upload_size
id731494
size15,471
Simon Johnston (johnstonskj)

documentation

https://docs.rs/codes-iso-17442/

README

Package codes-iso-17442

This package contains an implementation of the ISO 17442 Legal Entity Identifier (LEI) specification.

crates.io docs.rs

The Legal Entity Identifier (LEI) is a unique global identifier for legal entities participating in financial transactions. Also known as an LEI code or LEI number, its purpose is to help identify legal entities on a globally accessible database. Legal entities are organisations such as companies or government entities that participate in financial transactions. The identifier is used in regulatory reporting to financial regulators and all financial companies and funds are required to have an LEI.

The ISO Specification defines a format for describing identifiers and including check digits to ensure validity. In turn The Global Legal Entity Identifier Foundation (GLEIF) is the top-level maintainer of the global registry of identifiers and as such has further refined the LEI format to contain the following components:

  1. Characters 1-4: Prefix used to ensure the uniqueness among codes from LEI issuers (Local Operating Units or LOUs).
  2. Characters 5-18: Entity-specific part of the code generated and assigned by LOUs according to transparent, sound and robust allocation policies. As required by ISO 17442, it contains no embedded intelligence.
  3. Characters 19-20: Two check digits as described in the ISO 17442 standard.

GLIEF also provides daily download files for all registered identifiers, and an LEI search API.

For notes on the design of the API, see the repository README.

Example

use codes_iso_17442::LegalEntityId;
use std::str::FromStr;

let lei = LegalEntityId::from_str("YZ83GD8L7GG84979J516").unwrap();

assert_eq!(lei.local_operating_unit(), "YZ83");
assert_eq!(lei.entity(), "GD8L7GG84979J5");
assert_eq!(lei.check_digits(), "16");

Features

By default only the serde feature is enabled.

  • serde - Enables serialization of the LegalEntityId type.
  • url - Enables the conversion between LEI and URL (URN) forms.

Changes

Version 0.1.3

  • Catering for new build module in codes-common

Version 0.1.2

  • Moved check digit code to common package
  • Implemented Standardized and FixedLengthCode traits.

Version 0.1.0

  • Initial release

TODO

TBD

Commit count: 158

cargo fmt