All Projects → arashmanteghi → national-code

arashmanteghi / national-code

Licence: MIT license
Simple implementation of Iranian national code validation

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to national-code

vayder
Easy and concise validations for Express routes
Stars: ✭ 26 (-16.13%)
Mutual labels:  validator, validation-library
ATGValidator
iOS validation framework with form validation support
Stars: ✭ 51 (+64.52%)
Mutual labels:  validator, validation-library
volder
volder is powerful Object schema validation lets you describe your data using a simple and readable schema and transform a value to match the requirements
Stars: ✭ 106 (+241.94%)
Mutual labels:  validator, validation-library
thai-citizen-id-validator
🦉 Validate Thai Citizen ID with 0 dependencies 🇹🇭
Stars: ✭ 35 (+12.9%)
Mutual labels:  validator, validation-library
FilterInputJs
Tiny and Powerful Library for limit an entry (text box,input) as number,string or more...
Stars: ✭ 37 (+19.35%)
Mutual labels:  validator, validation-library
Validot
Validot is a performance-first, compact library for advanced model validation. Using a simple declarative fluent interface, it efficiently handles classes, structs, nested members, collections, nullables, plus any relation or combination of them. It also supports translations, custom logic extensions with tests, and DI containers.
Stars: ✭ 198 (+538.71%)
Mutual labels:  validator, validation-library
Vee Validate
✅ Form Validation for Vue.js
Stars: ✭ 8,820 (+28351.61%)
Mutual labels:  validator, validation-library
cron-validate
A cron-expression validator for TypeScript/JavaScript projects.
Stars: ✭ 40 (+29.03%)
Mutual labels:  validator, validation-library
finspec-spec
Multi-protocol, machine-readable specifications for financial services
Stars: ✭ 18 (-41.94%)
Mutual labels:  validator
validation
Developer experience focused validator.
Stars: ✭ 15 (-51.61%)
Mutual labels:  validator
guice-validator
Guice javax.validation method validation integration
Stars: ✭ 35 (+12.9%)
Mutual labels:  validator
toolbox
dein ToolBox - C# .Net Library with utilities like: command line, files, log, platform, shell, system, transform and validation [ Win+Mac+Linux ]
Stars: ✭ 46 (+48.39%)
Mutual labels:  validation-library
rust-phonenumber
Library for parsing, formatting and validating international phone numbers.
Stars: ✭ 99 (+219.35%)
Mutual labels:  validator
ngx-translate-lint
Simple CLI tools for check `ngx-translate` keys
Stars: ✭ 25 (-19.35%)
Mutual labels:  validator
hey-validator
Data validator
Stars: ✭ 14 (-54.84%)
Mutual labels:  validator
reach-schema
Functional schema-driven JavaScript object validation library.
Stars: ✭ 34 (+9.68%)
Mutual labels:  validation-library
valite
🔥 Concurrently execute your validators in a simple, practical and light validator engine.
Stars: ✭ 20 (-35.48%)
Mutual labels:  validator
fake-numbers
Generate fake, valid numbers. Check if a number is valid. Support a lot of different numbers: Credit card, EAN, ISBN, RTN, VIN, etc.
Stars: ✭ 51 (+64.52%)
Mutual labels:  validator
djburger
Framework for safe and maintainable web-projects.
Stars: ✭ 75 (+141.94%)
Mutual labels:  validator
aio-openapi
A python module for building OpenAPI compliant asynchronous Rest Servers. Auto documentation, serialization and validation in the same unified API.
Stars: ✭ 27 (-12.9%)
Mutual labels:  validation-library

National Code

Simple library to validate Iranian national code.

Install

Install with npm or Yarn:

npm:

npm install national-code --save

Yarn (note that yarn add automatically saves the package to the dependencies in package.json):

yarn add national-code

Usage

import nationalCode from 'natioanl-code';
nationalCode(4839941637); // => true
nationalCode(4839941638); // => false
nationalCode('4839941637'); // => true
nationalCode('4839941638'); // => false
nationalCode('2222222222'); // => false
nationalCode(3333333333); // => false

or:

var nationalCode = require('national-code');
nationalCode('4839941637'); // => true

Lunch demo as indepented project

  1. git clone https://github.com/arashmanteghi/national-code.git
  2. Run npm install
  3. Start the http-server using npm start
  4. Open http://localhost:9000

Commands

  • npm start - start the http-server
  • npm run build - build as production
  • npm run lint - run an ESLint check
  • npm run coverage - run code coverage and generate report in the coverage folder
  • npm test - run all tests
  • npm run test:watch - run all tests in watch mode

Licence

national-code is available under MIT.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].