New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

fast-lei

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fast-lei

Javascript tool to validate or generate control key for Legal Entity Identifier

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
103
increased by5.1%
Maintainers
1
Weekly downloads
 
Created
Source

luhn

Javascript tool to validate or generate control key for Legal Entity Identifier

Usage

In node.js

var LEI = require('fast-lei');

LEI.isValid('969500T3MBS4SQAMHJ45'); // false
LEI.isValid('724500VKKSH9QOLTFR81'); // true

LEI.generate('969500KSV493XWY0PS'); // 969500KSV493XWY0PS33

LEI.getMod97('724500884QS64MG71N'); // 76

API

isValid

Check input value, must be not null, not undefined and of type string.

The stringified value must respect LEI format (/^[0-9A-Z]{18}[0-9]{2}$/).

Check the value againt modulo 97 and must be equals to 1.

Returns boolean.

generate

Check input value, must be not null, not undefined and of type string.

The stringified value must respect LEI forma0 without ending control digits (/^[0-9A-Z]{18}$/).

Returns input value with check digits appended at the end.

getMod97

Compute modulo 97 remainder.

Fast entry: you must ensure that given rawValue is not null or empty and respect format /^[0-9A-Z]{1,}$/.

Note: Remainder cannot be directly used as check digits. To generate check digits, please refer to method generate.

Keywords

FAQs

Package last updated on 19 Oct 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc