Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@adia-technology/international-ssn-validator

Package Overview
Dependencies
Maintainers
5
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@adia-technology/international-ssn-validator

A utility to validate social security number of different countries.

  • 0.3.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
5
Created
Source

International SSN Validator

This utility checks validity of Social Security Numbers. Currently supported countries are USA and Switzerland.

Getting started

Installation

npm install @adia-technology/international-ssn-validator --save

Usage

import { validateSsn, ValidationResult } from '@adia-technology/international-ssn-validator';

let validationResult = validateSsn('756.1111.2222.00', 'ch');
let isValid = validationResult === ValidationResult.Valid;

API

This library exposes a single function, validateSsn, that accepts two parameters:

  • ssn : string - SSN to validate.
  • countryCode : string - country for which to check the SSN against. Currently supported are us and ch.

It returns a ValidationResult, which essentially is a string enum being set to one of the values: 'VALID', 'INVALID_FORMAT' or 'INVALID_CHECKSUM'.

Dependencies

This library uses the following other libraries:

  • ahv13-validator (ISC License)
  • ssn-validator (MIT Lincense)

Keywords

FAQs

Package last updated on 10 Aug 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

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