Skip to content

amculin/ektp-nik-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

e-KTP NIK Generator

Packagist Download GitHub Repo stars Packagist Version

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages