npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@credentum/parse-figi

v0.0.1

Published

Validate and parse FIGI (Financial Instrument Global Identifier) strings with check digit verification. Zero dependencies.

Readme

parse-figi

Validate and parse FIGI (Financial Instrument Global Identifier) strings. Returns structured data: provider prefix, body, check digit, and validation status.

Installation

npm install @credentum/parse-figi

Usage

import { parseFIGI } from '@credentum/parse-figi';

const result = parseFIGI('BBG000BLNNH6');
// => {
//   raw: 'BBG000BLNNH6',
//   valid: true,
//   prefix: 'BB',
//   body: 'G000BLNNH',
//   checkDigit: '6',
//   computedCheckDigit: '6',
//   provider: 'Bloomberg'
// }

Quick Validation

import { isValidFIGI } from '@credentum/parse-figi';

isValidFIGI('BBG000BLNNH6'); // true  (IBM)
isValidFIGI('BBG000BLNNH0'); // false (bad check digit)

Compute a Check Digit

import { computeCheckDigit } from '@credentum/parse-figi';

computeCheckDigit('BBG000BLNNH'); // '6'

Why?

FIGI is the OMG standard for uniquely identifying financial instruments (ANSI X9.145-2021). Regulated reporting under MiFID II and CAT requires FIGI validation. There is no existing npm package that validates FIGI identifiers.

parse-figi gives you:

  • Validation via Modulus 10 Double Add Double (Luhn variant) check digit
  • Parsing that extracts provider prefix, body, and check digit
  • Provider identification — recognizes Bloomberg (BB) and Kaiko (KK) prefixes
  • Excluded-prefix detection — flags BS, BM, GG, GB, VG, GH, KY per spec
  • Zero dependencies, pure TypeScript, <2KB

API

parseFIGI(figi: string): FIGIResult

Parse a 12-character FIGI string into structured data.

interface FIGIResult {
  raw: string;               // Original input
  valid: boolean;            // Format correct + check digit matches
  prefix: string;            // Positions 1-2 (provider code)
  body: string;              // Positions 3-11
  checkDigit: string;        // Position 12 (provided)
  computedCheckDigit: string; // What position 12 should be
  provider: string;          // Known provider name or 'Unknown'
}

isValidFIGI(figi: string): boolean

Returns true if the FIGI has valid format and correct check digit.

computeCheckDigit(figi11: string): string

Compute the check digit for the first 11 characters of a FIGI. Returns a single digit character, or empty string if input is invalid.

Validation Rules

Per the OMG FIGI specification and ANSI X9.145-2021:

  1. Exactly 12 characters
  2. Characters: uppercase consonants (B-Z, no vowels) and digits 0-9
  3. Positions 1-2: uppercase consonants only (no digits)
  4. Position 3: always G
  5. Position 12: check digit (Modulus 10 Double Add Double)
  6. Prefixes BS, BM, GG, GB, VG, GH, KY are excluded (ISIN collision avoidance)

Test Vectors

| FIGI | Security | Valid | |------|----------|-------| | BBG000BLNNH6 | IBM | yes | | BBG000BPH459 | Microsoft | yes | | BBG001S5N8V8 | Apple | yes | | BBG000BLNNH0 | (bad check digit) | no | | AAG000BLNNH6 | (vowel in prefix) | no | | BSG000BLNNH6 | (excluded prefix) | no |

License

MIT