Skip to content

Parse, format and validate a Creditor Identifier (CID)

License

Notifications You must be signed in to change notification settings

jhermsmeier/node-creditor-id

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Creditor Identifier

npm npm license npm downloads build status

Install via npm

$ npm install creditor-id

Usage

var CreditorId = require( 'creditor-id' )

Parsing CIDs

var cid = new CreditorId( 'DE98ZZZ09999999999' ) // OR
var cid = CreditorId.parse( 'DE98ZZZ09999999999' )
CreditorId {
  countryCode: 'DE',
  checksum: '98',
  businessCode: 'ZZZ',
  nationalId: '09999999999'
}

Calculating and validating checksums

var checksum = cid.getChecksum() // > '98'
if( cid.check() ) {
  // The CID's checksum is valid
}

Formatting a CID

cid.toString() // > 'DE98ZZZ09999999999'

About

Parse, format and validate a Creditor Identifier (CID)

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published