istckimlik
v1.2.6
Published
A tool for validate Turkish Identification Number
Downloads
124
Maintainers
Readme
isTCKimlik

A tool for validate Turkish Identification Number
Installation
You can install this component via npm or yarn
npm install istckimlik
yarn add istckimlikUsage
CommonJS
const { isTCKimlik } = require('istckimlik');
// Pass a number to validate
const isValid = isTCKimlik(48265878901);
console.log(isValid); // returns true or falseES Module / TypeScript
import { isTCKimlik } from 'istckimlik';
// The function accepts a number and returns a boolean
const isValid: boolean = isTCKimlik(48265878901);
console.log(isValid); // returns true or falseValidation Rules
A valid Turkish ID must meet these criteria:
- Must be exactly 11 digits
- Cannot start with 0
- Must pass the checksum validation (mod 10 checks)
Notes
- Input must be a number type
- Returns
trueif the ID is valid,falseotherwise
