GithubHelp home page GithubHelp logo

albertfdp / dni-js Goto Github PK

View Code? Open in Web Editor NEW
4.0 3.0 2.0 1.28 MB

Compute and validate a Spanish DNI/NIE number

License: MIT License

JavaScript 100.00%
dni nie number numero validate validar compute calculo spain spanish

dni-js's People

Contributors

albertfdp avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

diegosanz jvmonjo

dni-js's Issues

Should "-" be removed?

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!

Clean/normalize dni method

It would be nice if there was a method to normalize a dni like

dni.normalize('   12 34 56 7 8-z') //=> '12345678-Z'

Adds upfront zeros to DNI

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!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.