amculin / ektp-generator
Random Indonesian ID (NIK) generator using PHP
0.7
2025-05-15 11:37 UTC
Requires (Dev)
This package is auto-updated.
Last update: 2025-05-15 11:52:43 UTC
README
Generate a valid NIK randomly.
Instalation
composer require amculin/ektp-generator
How to use
use amculin\ektp\generator\KTP; $identity = new KTP(); echo "NIK: {$identity->getNIK()}";
Output:
NIK: 3404086801690002
You can also get the other informations based on the generated NIK
echo "Province: {$identity->getProvince()->id} - {$identity->getProvince()->name}\n"; echo "City: {$identity->getCity()->id} - {$identity->getCity()->name}\n"; echo "District: {$identity->getDistrict()->id} - {$identity->getDistrict()->name}\n"; $birthDate = $identity->getBirthDate()->birthDate; $date = $identity->getBirthDate()->date; $month = $identity->getBirthDate()->month; $year = $identity->getBirthDate()->year; echo "Birth Date: {$birthDate} / {$date}-{$month}-{$year}\n";
Output:
Province: 34 - Daerah Istimewa Yogyakarta City: 04 - Kab. Sleman District: 08 - Berbah Birth Date: 680169 / 28-01-1969
Todo
- OOP Enhancement
- add unit testing
- parameterized generator (by age, province, city, etc.)
- option get dataset from API