albertfdp / dni-js Goto Github PK
View Code? Open in Web Editor NEWCompute and validate a Spanish DNI/NIE number
License: MIT License
Compute and validate a Spanish DNI/NIE number
License: MIT License
Hi,
It's great to have this package so I can get rid of some "not as handy" gists.
One thing is, I've always stored DNIs witouth the "-" char between the number and the letter. This is: 12345678Z
instead of 12345678-Z
.
I don't know for sure which the official format so I made some research and found these:
in both cases, it doesn't include the "-" char in the format (in other cases they show a DNI containing the "-" as invalid) so... I'm thinking the valid format shouldn't include it.
¿Could the "-" be optional in this lib?
Thanks!
It would be nice if there was a method to normalize a dni like
dni.normalize(' 12 34 56 7 8-z') //=> '12345678-Z'
Hi,
I have a valid DNI, i.e: 05821400P
. Usually, when you get DNIs from excel files or other softwares, you will get this one as 5821400P
(note the missing 0 at the beginning.
It would be nice if the normalize
function adds that zero when needed.
Thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.