

=encoding UTF-8

=head1 NAME

IP::China - decide whether an internet address is from China

=head1 SYNOPSIS

    
    use utf8;
    use IP::China 'chinese_ip';
    if (chinese_ip ('127.0.0.1')) {
        print '你好';
    }


=head1 VERSION

This documents IP::China version 20180703
corresponding to git commit L<3e01997b421c99d7ef5beb8e695a7a756b031f23|https://github.com/benkasminbullock/chinese-ip/commit/3e01997b421c99d7ef5beb8e695a7a756b031f23> released on Wed Jul 11 15:44:59 2018 +0900. 

This module incorporates the MaxMind GeoLite data of date 20180703 (YYYYMMDD).

=head1 DESCRIPTION

Decide whether an IP address originates from China.

=head1 FUNCTIONS

The module has only one function:

=head2 chinese_ip

    my $is_chinese = chinese_ip ('255.255.255.255');

Given an internet protocol string (version 4), decide whether it is
Chinese or not. The return value is a true value (-1) if the address
is from China, and a false value (0) if the address is not from China.

=head1 UPDATES

The module will be periodically updated. Allocated addresses for China
may change. The script to build updates is included in L<the git
repository|https://github.com/benkasminbullock/chinese-ip> for this distribution.

The script also includes some errata for the MaxMind list.

=head1 ERRATA

The data block as follows:

    74.125.16.64/26,1814991,6252001,,0,0

is recorded as in China (country code 1814991), but this block seems
to belong to Google & not be in China, so this is discounted from the
results.

=head1 SEE ALSO

L<http://www.lemoda.net/networking/block-china/> contains an article
and some links to further information.



=head1 AUTHOR

Ben Bullock, <bkb@cpan.org>

=head1 COPYRIGHT & LICENCE

This package and associated files are copyright (C) 
2013-2018
Ben Bullock.

You can use, copy, modify and redistribute this package and associated
files under the Perl Artistic Licence or the GNU General Public
Licence.




=head2 DATA COPYRIGHT

This product includes GeoLite data created by MaxMind, available from
L<http://www.maxmind.com>. The GeoLite databases are distributed under
the Creative Commons Attribution-ShareAlike 3.0 Unported License. The
GeoLite data is in the file F<block-china-data.c> of the distribution.

