PHPackages                             chtang/idnumber - 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. [Validation &amp; Sanitization](/categories/validation)
4. /
5. chtang/idnumber

ActiveLibrary[Validation &amp; Sanitization](/categories/validation)

chtang/idnumber
===============

身分證字號檢查

v1.1.0(3y ago)026MITPHPPHP &gt;=7.2.0

Since Dec 22Pushed 3y ago1 watchersCompare

[ Source](https://github.com/tangchienhao/idnumber)[ Packagist](https://packagist.org/packages/chtang/idnumber)[ RSS](/packages/chtang-idnumber/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (1)Versions (3)Used By (0)

chtang/idnumber
===============

[](#chtangidnumber)

身分證字號、統一編號檢查

PHP版本限制
=======

[](#php版本限制)

PHP &gt;= 7.2

安裝
==

[](#安裝)

正式版

```
composer require chtang/idnumber
```

開發版

```
composer require chtang/idnumber:dev-main
```

使用
==

[](#使用)

```
use Chtang\Idnumber\TwId;
use Chtang\Idnumber\TwTaxId;

//驗證本國國民身分證號
TwId::verifyIdByNative('A123456789'); // true
TwId::verifyIdByNative('A223456789'); // false

//驗證110年起新式外來人口統一證號
TwId::verifyIdByResident('A806754477'); // true
TwId::verifyIdByResident('A906754477'); // false

//驗證109年(含)以前舊式外來人口統一證號
TwId::verifyIdByResidentOld('AC17003729'); // true
TwId::verifyIdByResidentOld('AB17003729'); // false

//判斷身分證號、居留證號之性別
TwId::getSex('A123456789'); // M
TwId::getSex('A223456781'); // F

//驗證統一編號
TwTaxId::verifyId('04595252'); // true
TwTaxId::verifyId('04595257'); // true
TwTaxId::verifyId('10458570'); // true
TwTaxId::verifyId('10458574'); // true
TwTaxId::verifyId('10458575'); // true
TwTaxId::verifyId('10458571'); // false
```

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 85.7% 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 ~1 days

Total

2

Last Release

1233d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/88a28e9b53e7f4d70b35c66b46d9f9659c9d723138015a666e4c5f0198058397?d=identicon)[Tang Chien-Hao](/maintainers/Tang%20Chien-Hao)

---

Top Contributors

[![tangchienhao-nuu](https://avatars.githubusercontent.com/u/92932459?v=4)](https://github.com/tangchienhao-nuu "tangchienhao-nuu (6 commits)")[![tangchienhao](https://avatars.githubusercontent.com/u/103393169?v=4)](https://github.com/tangchienhao "tangchienhao (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/chtang-idnumber/health.svg)

```
[![Health](https://phpackages.com/badges/chtang-idnumber/health.svg)](https://phpackages.com/packages/chtang-idnumber)
```

###  Alternatives

[webmozart/assert

Assertions to validate method input/output with nice error messages.

7.6k894.0M1.2k](/packages/webmozart-assert)[bensampo/laravel-enum

Simple, extensible and powerful enumeration implementation for Laravel.

2.0k15.9M104](/packages/bensampo-laravel-enum)[swaggest/json-schema

High definition PHP structures with JSON-schema based validation

48612.5M73](/packages/swaggest-json-schema)[stevebauman/purify

An HTML Purifier / Sanitizer for Laravel

5325.6M19](/packages/stevebauman-purify)[ashallendesign/laravel-config-validator

A package for validating your Laravel app's config.

217905.3k5](/packages/ashallendesign-laravel-config-validator)[crazybooot/base64-validation

Laravel validators for base64 encoded files

1341.9M8](/packages/crazybooot-base64-validation)

PHPackages © 2026

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