Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
This is a clone of fng-ssn-tools just in node.js
A small library providing one an ability to validate a social security number, find a state where SSN was issued, and generate a fake social security numbers for testing your application.
npm install ssn -g
let {ParseSSN, RandomSSN} = require('ssn');
let randomSSN = new RandomSSN();
console.log("SSN string:", randomSSN.value().toString()); //023121234
console.log("SSN formatted string", randomSSN.value().toFormattedString()); //023-12-1234
console.log("SSN state", randomSSN.value().state().toString()); // FL
let parseSSN = new ParseSSN('516386083');
console.log("SSN state", parseSSN.ssn().state().toString());
npm test
Class generates random social security number, optionally accepts state ANSI string (Ex. FL, NY, etc.).
let randomSSN = new RandomSSN();
let randomSSNFromState = new RandomSSN('FL');
let ssnString = randomSSN.value().toString();
let stateANSIString = randomSSN.value().state().toString();
Method returning generated SSN object
Class parsing SSN string and performs validity of SSN, if SSN is invalid, RangeError exception is thrown.
let parseSSN = new ParseSSN('516386083');
let ssnString = parseSSN.value().toString();
Method returning generated SSN object
Class with helper methods to deal with SSN string
Returns formatted SSN string 'xxx-xx-xxxx'
Returns SSN in a string format 'xxxxxxxxx'
Returns SSNState object
Class helping to deal with states in relation to SSN
Return ANSI string for state
If you find a bug or willing to add some enhancement, pull requests are very welcome
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
FAQs
Validate and generate fake SSN
The npm package ssn receives a total of 3,177 weekly downloads. As such, ssn popularity was classified as popular.
We found that ssn demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.