uphold/ein-validator

Name: ein-validator

Owner: Uphold

Description: Validate and mask a U.S. Employer Identification Number (EIN)

Created: 2015-10-06 17:14:58.0

Updated: 2017-07-18 17:15:16.0

Pushed: 2017-07-18 18:27:26.0

Homepage:

Size: 12

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

ein-validator

Validate and mask a U.S. Employer Identification Number (EIN).

Status

npm version build status

Installation

Install the package via npm:

install ein-validator --save
Usage
isValid(value)

This method validates if the given value is a valid Employer Identification Number.

Arguments
  1. value (*): The value to validate.
Returns

(boolean): Returns whether the input value is a valid EIN or not.

Example
lid({});
> false

lid('0112345-67');
> false

lid('01-1234567');
> true

lid('011234567');
> true

mask(value)

This method will help you protect this sensitive piece of information by obfuscating some digits.

Arguments
  1. value (*): The value to mask.
Returns

(string): Returns the masked value by replacing value certain digits by 'X'.

Example
({});
hrows an Error.

('0112345-67');
hrows an Error.

('01-1234567');
> XX-XXX0000

('011234567');
> XXXXX4567

Tests

To test using a local installation of node.js:

test

To test using Docker exclusively:

er-compose run --rm sut
Release
version [<newversion> | major | minor | patch] -m "Release %s"
License

MIT


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.