mirror of
https://github.com/lionsoul2014/ip2region.git
synced 2025-12-08 19:25:22 +00:00
21 lines
477 B
C#
21 lines
477 B
C#
using System.Buffers.Binary;
|
|
|
|
namespace IP2Region.Net.XDB;
|
|
|
|
public struct Version
|
|
{
|
|
public int IndexSize { get; set; }
|
|
|
|
public int Length { get; set; }
|
|
|
|
public uint GetVectorIndexStartPos(ReadOnlyMemory<byte> buffer)
|
|
{
|
|
return BinaryPrimitives.ReadUInt32LittleEndian(buffer.Span);
|
|
}
|
|
|
|
public uint GetVectorIndexEndPos(ReadOnlyMemory<byte> buffer)
|
|
{
|
|
return BinaryPrimitives.ReadUInt32LittleEndian(buffer.Slice(Length).Span);
|
|
}
|
|
}
|