All Projects → jukbot → thai-citizen-id-validator

jukbot / thai-citizen-id-validator

Licence: Apache-2.0 License
🦉 Validate Thai Citizen ID with 0 dependencies 🇹🇭

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to thai-citizen-id-validator

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 (+465.71%)
Mutual labels:  validation, validator, validation-library
Vee Validate
✅ Form Validation for Vue.js
Stars: ✭ 8,820 (+25100%)
Mutual labels:  validation, validator, validation-library
checker
Golang parameter validation, which can replace go-playground/validator, includes ncluding Cross Field, Map, Slice and Array diving, provides readable,flexible, configurable validation.
Stars: ✭ 62 (+77.14%)
Mutual labels:  validation, validator
openui5-validator
A library to validate OpenUI5 fields
Stars: ✭ 17 (-51.43%)
Mutual labels:  validation, validator
pyvaru
Rule based data validation library for python 3.
Stars: ✭ 17 (-51.43%)
Mutual labels:  validation, validator
vayder
Easy and concise validations for Express routes
Stars: ✭ 26 (-25.71%)
Mutual labels:  validator, validation-library
validation
Aplus Framework Validation Library
Stars: ✭ 99 (+182.86%)
Mutual labels:  validation, validator
Maat
Validation and transformation library powered by deductive ascending parser. Made to be extended for any kind of project.
Stars: ✭ 27 (-22.86%)
Mutual labels:  validation, validator
ATGValidator
iOS validation framework with form validation support
Stars: ✭ 51 (+45.71%)
Mutual labels:  validator, validation-library
openapi-lint-vscode
OpenAPI 2.0/3.0.x intellisense, validator, linter, converter and resolver extension for Visual Studio Code
Stars: ✭ 47 (+34.29%)
Mutual labels:  validation, validator
datalize
Parameter, query, form data validation and filtering for NodeJS.
Stars: ✭ 55 (+57.14%)
Mutual labels:  validation, validator
dockerfile-utils
A library and command line interface for formatting and linting Dockerfiles.
Stars: ✭ 17 (-51.43%)
Mutual labels:  validation, validator
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 (+202.86%)
Mutual labels:  validator, validation-library
national-code
Simple implementation of Iranian national code validation
Stars: ✭ 31 (-11.43%)
Mutual labels:  validator, validation-library
node-input-validator
Validation library for node.js
Stars: ✭ 74 (+111.43%)
Mutual labels:  validation, validator
FilterInputJs
Tiny and Powerful Library for limit an entry (text box,input) as number,string or more...
Stars: ✭ 37 (+5.71%)
Mutual labels:  validator, validation-library
valify
Validates data in JavaScript in a very simple way
Stars: ✭ 13 (-62.86%)
Mutual labels:  validation, validation-library
python-valid8
Yet another validation lib ;). Provides tools for general-purpose variable validation, function inputs/outputs validation as well as class fields validation. All entry points raise consistent ValidationError including all contextual details, with dynamic inheritance of ValueError/TypeError as appropriate.
Stars: ✭ 24 (-31.43%)
Mutual labels:  validation, validator
Password Validator
Validates password according to flexible and intuitive specification
Stars: ✭ 224 (+540%)
Mutual labels:  validation, validation-library
cron-validate
A cron-expression validator for TypeScript/JavaScript projects.
Stars: ✭ 40 (+14.29%)
Mutual labels:  validator, validation-library

Thai Citizen ID Validator

Build Status javascript style guide npm

A simpler way to validate Thai Citizen Card ID. 🇹🇭

Further Plans

  • Go Language Implementation Example
  • Thai Passport Number Validation

Read the article

Building Thai Citizen ID Input Validation with WCAG Standard

Installation

$ npm install thai-id-validator
# or
$ yarn add thai-id-validator

Data Type

Input Output
String boolean

Usage

Javascipt ES5

Just import script with commonjs

var validThaiID = require('thai-id-validator') // for ES5

var result = validThaiID(‘1101700207030’);
// return true

Javascript ES6 Module

In Javascript file, you can use import, export modules

'use strict';
import validThaiID from 'thai-id-validator';

let result = validThaiID(‘1101700207030’);
// return true

Test

To run all test cases run the following command

npm run test

You can edit validator.test.js too add your custom test case.

Test Cases Result
1112034563562
1101700230705
110170023073
11017002070d3
rytege54fsfsf
0
'-'
''
null
'blablabla'

(Tested with Jest)

Test Result Screenshot

Compatibility

Supports all major browsers and IE11+

IE / Edge
IE / Edge
Firefox
Firefox
Chrome
Chrome
Safari
Safari
Opera
Opera
11+ 44+ 45+ 11+ 32+

Issues

If you found any 🐞 or feedback, please report the issue here

Contribution

👩🏻‍💻 Contribute are always welcome.

License

Apache2.0

Code with love 🦉

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].