Skip to content

Instantly share code, notes, and snippets.

View cjavad's full-sized avatar
🐬
PHP'ing ;)

Javad Shafique cjavad

🐬
PHP'ing ;)
View GitHub Profile
@cjavad
cjavad / M11.js
Last active May 24, 2022 19:16
Module 11 integration in javascript/nodejs with 18 integers
// M11.js
/*
* Modules 11 control algorithm it's used
* Used by the danish goverment to validate CPR numbers (social security numbers).
* It works by having a number list and giving them each a weight from 2 to 7 then
* multiplying them to then divide the number with the mod (11 usually)
* to see if the reminder is 0.
*
* the modules operator (%) in javascript takes bad values.