
Research
/Security News
npm Package Uses Prompt Injection and Token Flooding to Disrupt AI Malware Scanners
A new npm package tests AI malware scanners with prompt injection, safety-triggering comments, context flooding, and obfuscated JavaScript.
swedish-ssn-tool
Advanced tools
Small utility for validating and generating Swedish social security number.
A modern JavaScript library for validating and generating Swedish Personal Numbers (Social Security Numbers).
# Using npm
npm install swedish-ssn-tool
# Using yarn
yarn add swedish-ssn-tool
# Using pnpm
pnpm add swedish-ssn-tool
import SwedishSSN from 'swedish-ssn-tool';
// Validate an SSN
const isValid = SwedishSSN.validate('870430-2713');
console.log(isValid); // true
// Generate a random SSN
const randomSSN = SwedishSSN.generateRandomSSN();
console.log(randomSSN); // e.g., '901224-1234'
// Generate SSN for specific gender and date
const femaleSSN = SwedishSSN.generateSSNWithParameters(
new Date('1990-12-24'),
'female'
);
<script src="https://unpkg.com/swedish-ssn-tool/dist/swedish-ssn.min.js"></script>
<script>
// Library is available as global SwedishSSN
const isValid = SwedishSSN.validate('20870430-2713');
console.log(isValid); // true
</script>
validate(ssn: string): booleanValidates a Swedish SSN. Returns true if valid, false otherwise.
SwedishSSN.validate('870430-2713'); // true
SwedishSSN.validate('20870430-2713'); // true (YYYY format)
SwedishSSN.validate('invalid'); // false
generateRandomSSN(): stringGenerates a random valid Swedish SSN.
const ssn = SwedishSSN.generateRandomSSN();
// Returns formatted SSN like '870430-2713'
generateSSNWithParameters(birthdate: Date, gender?: 'male' | 'female'): stringGenerates a valid SSN with specified parameters.
// Generate female SSN
const femaleSSN = SwedishSSN.generateSSNWithParameters(
new Date('1987-04-30'),
'female'
);
// Generate male SSN
const maleSSN = SwedishSSN.generateSSNWithParameters(
new Date('1987-04-30'),
'male'
);
// Generate random gender SSN
const randomSSN = SwedishSSN.generateSSNWithParameters(
new Date('1987-04-30')
);
# Install dependencies
npm install
# Run tests
npm test
# Build distribution files
npm run build
# Lint code
npm run lint
# Format code
npm run format
Swedish Personal Numbers follow this format:
Where:
git checkout -b feature/amazing-feature)git commit -m 'Add some amazing feature')git push origin feature/amazing-feature)teaddict - GitHub
FAQs
Small utility for validating and generating Swedish social security number.
The npm package swedish-ssn-tool receives a total of 108 weekly downloads. As such, swedish-ssn-tool popularity was classified as not popular.
We found that swedish-ssn-tool 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
A new npm package tests AI malware scanners with prompt injection, safety-triggering comments, context flooding, and obfuscated JavaScript.

Product
Socket now detects supply chain risks in project manifests, starting with missing lockfiles that can make dependency installs non-reproducible.

Research
/Security News
The trojanized extensions use TinyGo-compiled WebAssembly and Solana transaction memos to resolve command-and-control infrastructure.