The National ID Number of Hong Kong. This page is generated from the registry metadata of the library.
| Property | Value |
|---|---|
| Country code | HKG, HK |
| ID type | National ID Number |
| Official name | 香港身份證 (HKID) |
| Also known as | National ID Number; 香港身份證 |
| Display format | L(L)######(C) |
| Input masks | L######(X), LL######(X) |
| Length | 8 to 11 |
| Example | A123456(3) |
| Checksum | yes |
| Checksum algorithm | Weighted sum mod 11 over char values (A=10..Z=35; single-letter IDs padded; remainder 1 → check char A) |
| Parsable | no |
The root entry registers every country:
import { validateNationalId } from 'idnumbers';
validateNationalId('HKG', 'A123456(3)').isValid; // true
To bundle only this country, import its definition from idnumbers/countries/hkg and pass it to register():
import { register, validateNationalId } from 'idnumbers/core';
import { country } from 'idnumbers/countries/hkg';
register(country);
validateNationalId('HKG', 'A123456(3)').isValid; // true