IP2Region.Net 2.0.2

dotnet add package IP2Region.Net --version 2.0.2
NuGet\Install-Package IP2Region.Net -Version 2.0.2
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="IP2Region.Net" Version="2.0.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add IP2Region.Net --version 2.0.2
#r "nuget: IP2Region.Net, 2.0.2"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install IP2Region.Net as a Cake Addin
#addin nuget:?package=IP2Region.Net&version=2.0.2

// Install IP2Region.Net as a Cake Tool
#tool nuget:?package=IP2Region.Net&version=2.0.2

IP2Region.Net

.NET client library for IP2Region

Installation

Install the package with NuGet

Install-Package IP2Region.Net

Usage

using IP2Region.Net.Abstractions;
using IP2Region.Net.XDB;

ISearcher searcher = new Searcher(CachePolicy , "your xdb file path");

Cache Policy Description

Cache Policy Description Thread Safe
CachePolicy.Content Cache the entire xdb data. Yes
CachePolicy.VectorIndex Cache vecotorIndex to speed up queries and reduce system io pressure by reducing one fixed IO operation. Yes
CachePolicy.File Completely file-based queries Yes

XDB File Description

Generate using maker, or download pre-generated xdb files

ASP.NET Core Usage

services.AddSingleton<ISearcher>(new Searcher(CachePolicy , "your xdb file path"));

Performance


BenchmarkDotNet=v0.13.2, OS=macOS 13.4.1 (c) (22F770820d) [Darwin 22.5.0]
Apple M1, 1 CPU, 8 logical and 8 physical cores
.NET SDK=7.0.306
  [Host]     : .NET 6.0.20 (6.0.2023.32017), Arm64 RyuJIT AdvSIMD
  DefaultJob : .NET 6.0.20 (6.0.2023.32017), Arm64 RyuJIT AdvSIMD


Method Mean Error StdDev
CachePolicy_Content 155.7 ns 0.46 ns 0.39 ns
CachePolicy_File 2,186.8 ns 34.27 ns 32.06 ns
CachePolicy_VectorIndex 1,570.3 ns 27.53 ns 22.99 ns

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

Apache License 2.0

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 is compatible. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETStandard 2.0

  • .NETStandard 2.1

    • No dependencies.
  • net6.0

    • No dependencies.
  • net7.0

    • No dependencies.

NuGet packages (4)

Showing the top 4 NuGet packages that depend on IP2Region.Net:

Package Downloads
DH.Services

DH框架服务库

TIA.Core.WebApiBase

TIA.Core.WebApiBase

IGeekFan.FreeKit.Infrastructure

基础包功能模块

CDynamic.Spider

Package Description

GitHub repositories (1)

Showing the top 1 popular GitHub repositories that depend on IP2Region.Net:

Repository Stars
xianhc/apevolo-api
基于 .Net 8 、SqlSugar、Vue、RBAC、前后端分离的开箱即用的企业级中后台管理系统
Version Downloads Last updated
2.0.2 8,307 10/2/2023
2.0.1 1,317 7/30/2023
2.0.0 1,239 7/26/2023
1.0.10 12,110 9/7/2022
1.0.6 395 9/7/2022
1.0.5 432 9/7/2022
1.0.4 417 9/7/2022
1.0.3 408 9/7/2022
1.0.2 375 9/6/2022
1.0.1 375 9/6/2022
1.0.0 371 9/6/2022

Please refer to CHANGELOG.md for details