fake_asia
๐ญ A realistic fake data generator library focused on Asian countries (China, Japan, South Korea, India)
ไธญๆๆๆกฃ | English
Introduction
fake_asia is a Rust library for generating realistic fake data specifically for Asian countries. It provides authentic formats for names, addresses, phone numbers, and more. Perfect for:
- ๐งช Unit and integration testing
- ๐ Development environment data population
- ๐ฏ API testing
- ๐ Privacy protection (replacing real user data with fake data)
- ๐ Documentation and demos
Supported Countries
- ๐จ๐ณ China - Complete Chinese data with real postal codes
- ๐ฏ๐ต Japan - Japanese data with authentic postal codes
- ๐ฐ๐ท South Korea - Korean data with real postal codes
- ๐ฎ๐ณ India - Indian data with genuine PIN codes
Features
๐จ๐ณ China Data Generation
- Names: 100 common surnames + male/female given names
- Mobile: Real carrier prefixes (130-189 series)
- Landline: Area codes + 7-8 digit numbers
- ID Card: 18-digit format with check digit
- Address: Province, city, street, 6-digit real postal code
- Company: City + keywords + company type
- License Plate: Province code + letter + number combination
- Email: Common domains (QQ, 163, Gmail, etc.)
๐ฏ๐ต Japan Data Generation
- Names: Common Japanese surnames and given names (male/female)
- Mobile: 090/080/070 series
- Landline: Area codes (03, 06, etc.) + numbers
- Address: Prefecture, city, street, 7-digit real postal code (XXX-XXXX format)
- Email: International domains
๐ฐ๐ท South Korea Data Generation
- Names: Common Korean surnames and given names (male/female)
- Mobile: 010 series
- Landline: Area codes (02, 051, etc.) + numbers
- Address: Province/city, district, street, 5-digit real postal code
- Email: International domains
๐ฎ๐ณ India Data Generation
- Names: Common Indian names (multicultural backgrounds)
- Mobile: 10-digit numbers with real prefixes (98, 99, 97, etc.)
- Landline: City area codes (022, 011, etc.) + 8-digit numbers
- Address: City, state, street, 6-digit real PIN code
- Email: International domains
Installation
Add to your Cargo.toml:
[]
= "0.1.0"
Quick Start
Basic Usage
use *;
use thread_rng;
Using the Trait
use *;
Complete Person Information
use *;
use thread_rng;
Batch Generation
use *;
use thread_rng;
Multi-Country Examples
use *;
use thread_rng;
API Documentation
Chinese Data
Names:
chinese_last_name(&mut rng)- Random surnamechinese_male_first_name(&mut rng)- Random male given namechinese_female_first_name(&mut rng)- Random female given namechinese_first_name(&mut rng)- Random given name (male/female)
Contact:
chinese_phone_number(&mut rng)- 11-digit mobile numberchinese_landline(&mut rng)- Landline with area codeemail(&mut rng)- Email address
Identity:
chinese_id_card(&mut rng)- 18-digit ID card with check digitchinese_license_plate(&mut rng)- License plate number
Location:
chinese_address(&mut rng)- Complete address (returnsChineseAddress)chinese_city(&mut rng)- City namechinese_company(&mut rng)- Company name (returnsChineseCompany)
Batch:
chinese_person(&mut rng)- Complete person informationchinese_persons(count, &mut rng)- Multiple persons
Japanese Data
japanese_last_name(&mut rng)- Surnamejapanese_male_first_name(&mut rng)- Male given namejapanese_female_first_name(&mut rng)- Female given namejapanese_phone_number(&mut rng)- Mobile (090-XXXX-XXXX)japanese_landline(&mut rng)- Landline (03-XXXX-XXXX)japanese_address(&mut rng)- Complete address with real postal codejapanese_city(&mut rng)- City namejapanese_person(&mut rng)- Complete person informationjapanese_persons(count, &mut rng)- Multiple persons
Korean Data
korean_last_name(&mut rng)- Surnamekorean_male_first_name(&mut rng)- Male given namekorean_female_first_name(&mut rng)- Female given namekorean_phone_number(&mut rng)- Mobile (010-XXXX-XXXX)korean_landline(&mut rng)- Landline (02-XXXX-XXXX)korean_address(&mut rng)- Complete address with real postal codekorean_city(&mut rng)- City namekorean_person(&mut rng)- Complete person informationkorean_persons(count, &mut rng)- Multiple persons
Indian Data
indian_last_name(&mut rng)- Surnameindian_male_first_name(&mut rng)- Male given nameindian_female_first_name(&mut rng)- Female given nameindian_phone_number(&mut rng)- Mobile (10-digit)indian_landline(&mut rng)- Landline (022-XXXXXXXX)indian_address(&mut rng)- Complete address with real PIN codeindian_city(&mut rng)- City nameindian_person(&mut rng)- Complete person informationindian_persons(count, &mut rng)- Multiple persons
Utility Functions
generate_multiple(count, &mut rng, generator)- Generic batch generation function
Data Structures
// Chinese address
// Japanese address
// Korean address
// Indian address
// Person information structures
Trait
Implemented for:
String- Generates Chinese full nameChineseAddress,JapaneseAddress,KoreanAddress,IndianAddressChineseCompany
Running Tests
View test output:
Run examples:
Data Sources
All data used in this library comes from public information:
- Names are common surnames and given names from respective countries
- Addresses use real city names and authentic postal codes
- Phone numbers use real carrier/area code prefixes
- Chinese ID cards follow GB 11643-1999 standard
- All generated data is randomly combined and does not correspond to real individuals
โ ๏ธ Note: Generated data is for testing purposes only. Do not use for fraud or illegal activities.
Roadmap
- Support more Asian countries (Singapore, Thailand, Vietnam, etc.)
- Add bank card number generation
- Add passport number generation
- Support export to JSON/CSV formats
- Add more realistic address data
- Integrate pinyin library for improved email generation
- Add business credit code generation
Contributing
Issues and Pull Requests are welcome!
License
This project is licensed under the MIT License. See LICENSE file for details.
Acknowledgments
Thanks to all contributors to this project!
If this project helps you, please give it a โญ๏ธ!