
Security News
AGENTS.md Gains Traction as an Open Format for AI Coding Agents
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
se-orgnr-validator
Advanced tools
Validator for Swedish company registration numbers (organisationsnummer) in Node.js
Validator for Swedish company registration numbers (organisationsnummer) in Node.js.
Fast, small and no dependencies.
$ npm install se-orgnr-validator
const orgnrValidator = require('se-orgnr-validator')
orgnrValidator('556016-0680')
//=> true
orgnrValidator(5560160680)
//=> true
orgnrValidator(55610160680)
//=> false
Type: string
The number to validate. Accepts either a string or an integer, meaning that you may omit the dash between the first 6 and the last 4 digits.
npm test
This module was partly created since I needed a quick solution for validating Swedish company registration numbers that had OK performance and quality. After looking at some other options available, I found some issues with them. For your convenience, here is my summarised benchmark test. Please note however, that this module was not purely written for speed reasons, and could probably be improved even further.
Tested with the following datasets:
The beenchmark was performed towards:
Tests made on Windows 10, 2.5GHz, 9GB RAM. Average of three iterations.
https://github.com/eckberg/se-orgnr-validator | https://github.com/perarnborg/se-org-no | |
---|---|---|
Correct numbers | 3ms | 16ms |
Long numbers | 160ms | 217ms |
Third digit | 121ms | 2.31s |
Random | 191ms | 1.70s |
Checksum | 190ms | 2.84s |
FAQs
Validator for Swedish company registration numbers (organisationsnummer) in Node.js
We found that se-orgnr-validator 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
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.