PHPackages                             amculin/ektp-generator - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. amculin/ektp-generator

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

amculin/ektp-generator
======================

Random Indonesian ID (NIK) generator using PHP

0.7(12mo ago)5473MITPHPCI passing

Since Aug 28Pushed 12mo ago1 watchersCompare

[ Source](https://github.com/amculin/ektp-nik-generator)[ Packagist](https://packagist.org/packages/amculin/ektp-generator)[ RSS](/packages/amculin-ektp-generator/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (1)Versions (6)Used By (0)

**e-KTP NIK Generator**
=======================

[](#e-ktp-nik-generator)

 [![Packagist Download](https://camo.githubusercontent.com/89f288984fa4f3b1d945935c90831f6f06812ec6356b088297a9c210f775ff56/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f616d63756c696e2f656b74702d67656e657261746f72)](https://camo.githubusercontent.com/89f288984fa4f3b1d945935c90831f6f06812ec6356b088297a9c210f775ff56/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f616d63756c696e2f656b74702d67656e657261746f72) [![Packagist Version](https://camo.githubusercontent.com/18b6d7e5feb6aa2404b885c6a260a0b80d681713eed7b1af47a89f8b99dde734/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f616d63756c696e2f656b74702d67656e657261746f72)](https://camo.githubusercontent.com/18b6d7e5feb6aa2404b885c6a260a0b80d681713eed7b1af47a89f8b99dde734/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f616d63756c696e2f656b74702d67656e657261746f72) [![Build Status](https://camo.githubusercontent.com/5320117ede801486d6cad5a2136544f010daa234c514a3a765313fca31c534f4/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f616d63756c696e2f656b74702d6e696b2d67656e657261746f722f74657374696e672e796d6c3f6c6162656c436f6c6f723d79656c6c6f7726636f6c6f723d626c7565)](https://camo.githubusercontent.com/5320117ede801486d6cad5a2136544f010daa234c514a3a765313fca31c534f4/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f616d63756c696e2f656b74702d6e696b2d67656e657261746f722f74657374696e672e796d6c3f6c6162656c436f6c6f723d79656c6c6f7726636f6c6f723d626c7565)

 [![GiHub Forks](https://camo.githubusercontent.com/6853a0384844482dae7e1a272fe97fe15c9a454c86d6b3d5a8434033e2ca1694/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f666f726b732f616d63756c696e2f656b74702d6e696b2d67656e657261746f72)](https://camo.githubusercontent.com/6853a0384844482dae7e1a272fe97fe15c9a454c86d6b3d5a8434033e2ca1694/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f666f726b732f616d63756c696e2f656b74702d6e696b2d67656e657261746f72) [![GitHub Repo stars](https://camo.githubusercontent.com/c0d01958fa8cedde1cffb2e95c4f738225be23c74a01a9ffe9e4ecd99a29881d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f616d63756c696e2f656b74702d6e696b2d67656e657261746f72)](https://camo.githubusercontent.com/c0d01958fa8cedde1cffb2e95c4f738225be23c74a01a9ffe9e4ecd99a29881d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f616d63756c696e2f656b74702d6e696b2d67656e657261746f72)

Generate a valid NIK randomly.

Instalation
-----------

[](#instalation)

```
composer require amculin/ektp-generator
```

How to use
----------

[](#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
----

[](#todo)

- OOP Enhancement
- add unit testing
- parameterized generator (by age, province, city, etc.)
- option get dataset from API

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance50

Moderate activity, may be stable

Popularity15

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity33

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~130 days

Total

3

Last Release

360d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0fe6825785ecfe0c1b9e700cc504d2bbe137891999ac22db1753547b2fbbcad7?d=identicon)[amculin](/maintainers/amculin)

---

Top Contributors

[![amculin](https://avatars.githubusercontent.com/u/4025450?v=4)](https://github.com/amculin "amculin (38 commits)")

---

Tags

phpgeneratoridentityindonesianikktpektp

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/amculin-ektp-generator/health.svg)

```
[![Health](https://phpackages.com/badges/amculin-ektp-generator/health.svg)](https://phpackages.com/packages/amculin-ektp-generator)
```

###  Alternatives

[genericmilk/docudoodle

Generate documentation for your Laravel application using OpenAI

15120.5k](/packages/genericmilk-docudoodle)[tomloprod/radiance

A deterministic mesh gradient avatar generator for PHP.

1393.7k](/packages/tomloprod-radiance)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
