mask(id)
Mask an ID number for privacy.
Signature
typescript
function mask(id: string): stringParameters
| Parameter | Type | Description |
|---|---|---|
| id | string | ID number |
Returns
Returns the masked ID in the format first 3 digits + *********** + last 4 digits.
Live Demo
Example
typescript
import { mask } from 'china-id-card'
mask('622922197808118498') // → '622***********8498'
mask('110101900101001') // → '110***********1001'