Crate idcard[][src]

Chinese Indentity Card Utilities

This package provides utilities to validate ID number, to extract detailed ID information, to upgrade ID number from 15-digit to 18-digit, to generate fake ID number, and some related functions for HongKong/Macau/Taiwan ID.

Modules

hk

Utilities for Hong Kong Identity Card

mo

Utilities for Macau Identity Card

region

Region query utilities(only includes mainland)

tw

Utilities for Taiwan Identity Card

Structs

FakeOptions

Options which can be used to configure how a fake ID number is generated.

Identity

An object representation of the Chinese ID.

Enums

Error

Custom error type.

Gender

The type of demographic genders

Functions

chinese_era

Returns the Chinese Era by the given year, the given year should not be less than 1000.

chinese_zodiac

Returns the Chinese Zodiac animal by the given year, the given year should not be less than 1000.

constellation

Returns the constellation by the given month and day.

new_fake

Generates a new fake ID number.

rand_fake

Generates a random fake ID number.

rand_fake_with_opts

Generates a random fake ID number using the given options.

upgrade

Upgrades a Chinese ID number from 15-digit to 18-digit.

validate

Validates a Chinese ID number(only supports 15/18-digit).