{"id":28495557,"url":"https://github.com/wzhe06/ipdatabase","last_synced_at":"2025-07-02T10:31:59.959Z","repository":{"id":6502278,"uuid":"54085677","full_name":"wzhe06/ipdatabase","owner":"wzhe06","description":"IP geolocation binary tree search","archived":false,"fork":false,"pushed_at":"2022-06-28T14:48:32.000Z","size":2974,"stargazers_count":339,"open_issues_count":7,"forks_count":173,"subscribers_count":20,"default_branch":"master","last_synced_at":"2025-06-08T11:43:41.780Z","etag":null,"topics":["binary-search-tree","ip-database","ip-geolocation","ipaddress"],"latest_commit_sha":null,"homepage":"https://github.com/wzhe06/ipdatabase","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wzhe06.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-03-17T03:27:11.000Z","updated_at":"2025-02-19T13:58:25.000Z","dependencies_parsed_at":"2022-07-20T14:02:37.992Z","dependency_job_id":null,"html_url":"https://github.com/wzhe06/ipdatabase","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/wzhe06/ipdatabase","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wzhe06%2Fipdatabase","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wzhe06%2Fipdatabase/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wzhe06%2Fipdatabase/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wzhe06%2Fipdatabase/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wzhe06","download_url":"https://codeload.github.com/wzhe06/ipdatabase/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wzhe06%2Fipdatabase/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263120780,"owners_count":23416882,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["binary-search-tree","ip-database","ip-geolocation","ipaddress"],"created_at":"2025-06-08T11:30:32.048Z","updated_at":"2025-07-02T10:31:59.951Z","avatar_url":"https://github.com/wzhe06.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ipdatabase\n二叉树快速搜索IP地址数据库\n\n# 数据\n数据源采用2015年广告协会制定的IP地址标准数据库，中国互联网广告行业统一采用的标准IP库。\n\n# 原理\n利用二叉树实现IP查询，首先将10进制IPV4地址转化为二进制构建二叉树，利用二叉树搜索进行搜索，查询时间复杂度log2n，比传统IP库n的查询速度高出一个量级。\n\n# 接口\n根据IP查询城市或地区的接口是IpHelper类中的findRegionByIp接口，说明如下：\n\n```\n/**\n * 静态方法，传入ip地址，返回ip地址所在城市或地区\n * @param ip    IP地址，例：58.30.15.255\n * @return  返回IP地址所在城市或地区，例：北京市\n */\npublic static String findRegionByIp(String ip)\n```\n\n# example\n```\npublic void example() throws Exception {\n    String ip = \"58.30.15.255\";\n    String region = IpHelper.findRegionByIp(ip);\n    System.out.println(region);\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwzhe06%2Fipdatabase","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwzhe06%2Fipdatabase","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwzhe06%2Fipdatabase/lists"}