🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

ein-validator

Package Overview
Dependencies
Maintainers
2
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ein-validator

Employer Identification Number validator and masker

1.0.1
latest
Source
npm
Version published
Weekly downloads
21K
0.75%
Maintainers
2
Weekly downloads
 
Created
Source

ein-validator

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

Status

npm version build status

Installation

Install the package via npm:

npm install ein-validator --save

Usage

isValid(value)

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

Arguments

  • value (*): The value to validate.

Returns

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

Example

isValid({});
// => false

isValid('0112345-67');
// => false

isValid('01-1234567');
// => true

isValid('011234567');
// => true

mask(value)

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

Arguments

  • value (*): The value to mask.

Returns

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

Example

mask({});
// Throws an Error.

mask('0112345-67');
// Throws an Error.

mask('01-1234567');
// => XX-XXX0000

mask('011234567');
// => XXXXX4567

Tests

To test using a local installation of node.js:

npm test

To test using Docker exclusively:

docker-compose run --rm sut

Release

npm version [<newversion> | major | minor | patch] -m "Release %s"

License

MIT

Keywords

EIN

FAQs

Package last updated on 20 Nov 2020

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