istckimlik
Version:
A tool for validate Turkish Identification Number
47 lines (31 loc) • 1.01 kB
Markdown
A tool for validate Turkish Identification Number
You can install this component via npm or yarn
```bash
npm install istckimlik
yarn add istckimlik
```
```js
const { isTCKimlik } = require('istckimlik');
// Pass a number to validate
const isValid = isTCKimlik(48265878901);
console.log(isValid); // returns true or false
```
```ts
import { isTCKimlik } from 'istckimlik';
// The function accepts a number and returns a boolean
const isValid: boolean = isTCKimlik(48265878901);
console.log(isValid); // returns true or false
```
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 `true` if the ID is valid, `false` otherwise