百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
I

ip2location

> 数据库
开源

适用于 Java 客户端和数据库 bin 文件的 IP2Location™。

100 stars0 点赞1 次浏览
访问官网GitHub

工具介绍

适用于 Java 客户端和数据库 bin 文件的 IP2Location™。

简体中文 | English

This site or product includes IP2Location LITE data available from http://www.ip2location.com

IP2Location for Java

The repository code is based on ip2location repository.

Example: https://www.renfei.net/kitbox/ip

Download

The update cycle of database bin file is once a month.

Database bin file:

  • Releases

Installing in maven

xml

    net.renfei
    ip2location
    1.2.6

Compared with the official client, I removed the ip2locationweb service and the dependency on other libraries.

Usage

…

Database Fields

Name Type Description
ip_from INT (10) / DECIMAL (39,0) First IP address show netblock.
ip_to INT (10) / DECIMAL (39,0) Last IP address show netblock.
country_code CHAR(2) Two-character country code based on ISO 3166.
country_name VARCHAR(64) Country name based on ISO 3166.
region_name VARCHAR(128) Region or state name.
city_name VARCHAR(128) City name.
latitude DOUBLE City latitude. Default to capital city latitude if city is unknown.
longitude DOUBLE City longitude. Default to capital city longitude if city is unknown.
zip_code VARCHAR(30) ZIP/Postal code.
time_zone VARCHAR(8) UTC time zone (with DST supported).

IPTOOLS CLASS

Methods

Below are the methods supported in this class.

Method Name Description
public boolean IsIPv4(String IPAddress) Returns true if string contains an IPv4 address. Otherwise false.
public boolean IsIPv6(String IPAddress) Returns true if string contains an IPv6 address. Otherwise false.
public BigInteger IPv4ToDecimal(String IPAddress) Returns the IP number for an IPv4 address.
public BigInteger IPv6ToDecimal(String IPAddress) Returns the IP number for an IPv6 address.
public String DecimalToIPv4(BigInteger IPNum) Returns the IPv4 address for the supplied IP number.
public String DecimalToIPv6(BigInteger IPNum) Returns the IPv6 address for the supplied IP number.
public String CompressIPv6(String IPAddress) Returns the IPv6 address in compressed form.
public String ExpandIPv6(String IPAddress) Returns the IPv6 address in expanded form.
public List IPv4ToCIDR(String IPFrom, String IPTo) Returns a list of CIDR from the supplied IPv4 range.
public List IPv6ToCIDR(String IPFrom, String IPTo) Returns a list of CIDR from the supplied IPv6 range.
public String[] CIDRToIPv4(String CIDR) Returns the IPv4 range from the supplied CIDR.
public String[] CIDRToIPv6(String CIDR) Returns the IPv6 range from the supplied CIDR.

Usage

…

Mirror

  • https://github.com/renfei/ip2location
  • https://gitlab.com/renfei/ip2location
  • https://jihulab.com/renfei/ip2location
  • https://gitee.com/rnf/ip2location

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Javaip2locationip2location-bin-databaseip2location-bin-databasesip2location-database

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类数据库
定价开源

> 相关工具

P
PostgreSQL
功能强大的开源关系型数据库
R
Redis
内存数据结构存储,常用作缓存与队列
M
MySQL
广泛使用的开源关系型数据库