Skip to content

Library to generate valid New Zealand data: IP, ZIP Code and City

License

Notifications You must be signed in to change notification settings

Oni4i/fake-nz-generator

Repository files navigation

fake-nz-generator

Generator of New Zealand valid data like IP, zip code and city

composer require oni4i/fake-nz-generator

If you need fake, but valid data like IP, ZIP code and City you can use this PHP library.

Generate random city

$cityGenerator = new CityGeneratorService();

//output "Ahaura"
$randCity1 = $cityGenerator->rand();

//output "Athol"
$randCity2 = $cityGenerator->rand();

Generate IPs

$ipGenerator = new IPGeneratorService();

//output "14.1.32.0"
$firstIP = $ipGenerator->first();

//output "14.1.32.1"
$nextIP = $ipGenerator->next($firstIP);

//output "14.1.32.0"
$prevIP = $ipGenerator->prev($firstIP);

//output "14.1.95.255"
$randIP = $ipGenerator->rand();

Generate ZIP codes

$zipGenerator = new ZipGeneratorService();

//output "7550"
$randZipCode = $zipGenerator->rand();

//output "9749"
$randZipCodeByCity = $zipGenerator->randByCity('Athol');

About

Library to generate valid New Zealand data: IP, ZIP Code and City

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published

Languages