Security News
pnpm 10.0.0 Blocks Lifecycle Scripts by Default
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
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
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.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.
Research
Security News
Socket researchers have discovered multiple malicious npm packages targeting Solana private keys, abusing Gmail to exfiltrate the data and drain Solana wallets.