Security News
Namecheap Takes Down Polyfill.io Service Following Supply Chain Attack
Polyfill.io has been serving malware for months via its CDN, after the project's open source maintainer sold the service to a company based in China.
clabe-validator
Advanced tools
Readme
<img src=https://centerkey.com/graphics/center-key-logo.svg align=right width=200 alt=logo>
JavaScript library to analyze or create a CLABE number for a Mexican bank account
Clave Bancaria Estandarizada (Spanish for "standardized banking cipher") is a banking standard from the Mexican Bank Association (Asociación de Bancos de México – ABM) for uniform numbering of bank accounts. See: https://en.wikipedia.org/wiki/CLABE
Try it out:
centerkey.com/clabe
In a web page:
<script src=clabe.min.js></script>
From the jsdelivr.com CDN:
<script src=https://cdn.jsdelivr.net/npm/clabe-validator@1.0/clabe.min.js></script>
In a Node.js project:
$ npm install clabe-validator
const clabe = require('clabe-validator');
Pass the CLABE number as an 18-character string into clabe.validate(clabeNum)
.
const clabeNum = '002010077777777771';
const clabeCheck = clabe.validate(clabeNum);
console.log(clabeCheck.error ? '¡Muy mal!' : '¡Que bueno!');
{
error: false,
bank: 'Banco Nacional de México',
city: 'Aguascalientes'
}
{
error: true,
message: 'Invalid city code'
}
Error message |
---|
Must be exactly 18 digits long |
Must be only numeric digits (no letters) |
Invalid checksum |
Invalid bank code |
Invalid city code |
Pass the bank code, city code, and account number into clabe.calculate(bankCode, cityCode, accountNumber)
and get the 18-character CLABE number back.
const clabeNum = clabe.calculate(2, 10, 7777777777);
console.log(clabeNum === '002010077777777771');
task-runner.sh.command
script. Make
your edits and rerun the script to ensure all the test cases pass. Pull requests welcome.CLABE Validator code is open source under the MIT License, and the documentation is published under the CC BY-SA 4.0 license.
FAQs
Analyze or create a CLABE number for a Mexican bank account (written in functional TypeScript)
The npm package clabe-validator receives a total of 2,427 weekly downloads. As such, clabe-validator popularity was classified as popular.
We found that clabe-validator demonstrated a healthy version release cadence and project activity because the last version was released less than 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
Polyfill.io has been serving malware for months via its CDN, after the project's open source maintainer sold the service to a company based in China.
Security News
OpenSSF is warning open source maintainers to stay vigilant against reputation farming on GitHub, where users artificially inflate their status by manipulating interactions on closed issues and PRs.
Security News
A JavaScript library maintainer is under fire after merging a controversial PR to support legacy versions of Node.js.