Merge pull request #23 from legigor/master

Add net5.0 support
This commit is contained in:
Melnik Alexander 2022-10-05 20:50:56 +03:00 committed by GitHub
commit 6b20e7f7b3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 916 additions and 909 deletions

View File

@ -1,5 +1,7 @@
<Project> <Project>
<PropertyGroup> <PropertyGroup>
<TargetFrameworks>net5.0;net6.0</TargetFrameworks>
<LangVersion>9.0</LangVersion>
<BenchmarkDotNet>0.13.1</BenchmarkDotNet> <BenchmarkDotNet>0.13.1</BenchmarkDotNet>
<MicrosoftSdk>17.2.0</MicrosoftSdk> <MicrosoftSdk>17.2.0</MicrosoftSdk>
<xUnit>2.4.1</xUnit> <xUnit>2.4.1</xUnit>

View File

@ -1,9 +1,8 @@
<Project> <Project>
<Import Project="deps.props" /> <Import Project="deps.props" />
<PropertyGroup> <PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<PackageId>Standart.Hash.xxHash</PackageId> <PackageId>Standart.Hash.xxHash</PackageId>
<VersionPrefix>4.0.4</VersionPrefix> <VersionPrefix>4.0.5</VersionPrefix>
<AssemblyName>Standart.Hash.xxHash</AssemblyName> <AssemblyName>Standart.Hash.xxHash</AssemblyName>
<AssemblyTitle>Standart.Hash.xxHash</AssemblyTitle> <AssemblyTitle>Standart.Hash.xxHash</AssemblyTitle>
<Authors>Oleksandr Melnyk</Authors> <Authors>Oleksandr Melnyk</Authors>

View File

@ -2,7 +2,6 @@
<Import Project="..\..\deps.props" /> <Import Project="..\..\deps.props" />
<PropertyGroup> <PropertyGroup>
<OutputType>Exe</OutputType> <OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<Optimize>true</Optimize> <Optimize>true</Optimize>

View File

@ -2,7 +2,6 @@
<Import Project="..\..\deps.props" /> <Import Project="..\..\deps.props" />
<PropertyGroup> <PropertyGroup>
<IsPackable>false</IsPackable> <IsPackable>false</IsPackable>
<TargetFramework>net6.0</TargetFramework>
<DebugType>full</DebugType> <DebugType>full</DebugType>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">

View File

@ -2,10 +2,10 @@ using System;
using System.Text; using System.Text;
using Xunit; using Xunit;
namespace Standart.Hash.xxHash.Test; namespace Standart.Hash.xxHash.Test
public class xxHash128Test
{ {
public class xxHash128Test
{
[Fact] [Fact]
public void Compute_hash128_for_bytes() public void Compute_hash128_for_bytes()
{ {
@ -110,4 +110,5 @@ public class xxHash128Test
Assert.Equal(expected[i], hash[i]); Assert.Equal(expected[i], hash[i]);
} }
}
} }

View File

@ -3,7 +3,6 @@
<Import Project="..\..\nuget.props" /> <Import Project="..\..\nuget.props" />
<PropertyGroup> <PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup> </PropertyGroup>

View File

@ -6,10 +6,10 @@
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
namespace Standart.Hash.xxHash; namespace Standart.Hash.xxHash
public partial class xxHash32
{ {
public partial class xxHash32
{
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
private static unsafe uint __inline__XXH32(byte* input, int len, uint seed) private static unsafe uint __inline__XXH32(byte* input, int len, uint seed)
{ {
@ -186,4 +186,6 @@ public partial class xxHash32
return h32; return h32;
} }
} }
}
} }

View File

@ -6,10 +6,10 @@
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
namespace Standart.Hash.xxHash; namespace Standart.Hash.xxHash
public partial class xxHash64
{ {
public partial class xxHash64
{
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
private static unsafe ulong __inline__XXH64(byte* input, int len, ulong seed) private static unsafe ulong __inline__XXH64(byte* input, int len, ulong seed)
{ {
@ -248,4 +248,5 @@ public partial class xxHash64
return h64; return h64;
} }
} }
}
} }

View File

@ -2,10 +2,10 @@
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
namespace Standart.Hash.xxHash; namespace Standart.Hash.xxHash
public static partial class xxHash32
{ {
public static partial class xxHash32
{
private static readonly uint XXH_PRIME32_1 = 2654435761U; private static readonly uint XXH_PRIME32_1 = 2654435761U;
private static readonly uint XXH_PRIME32_2 = 2246822519U; private static readonly uint XXH_PRIME32_2 = 2246822519U;
private static readonly uint XXH_PRIME32_3 = 3266489917U; private static readonly uint XXH_PRIME32_3 = 3266489917U;
@ -17,4 +17,5 @@ public static partial class xxHash32
{ {
return (x << r) | (x >> (32 - r)); return (x << r) | (x >> (32 - r));
} }
}
} }

View File

@ -9,10 +9,10 @@ using System.Runtime.InteropServices;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace Standart.Hash.xxHash; namespace Standart.Hash.xxHash
public static partial class xxHash32
{ {
public static partial class xxHash32
{
/// <summary> /// <summary>
/// Compute xxHash for the data byte array /// Compute xxHash for the data byte array
/// </summary> /// </summary>
@ -261,4 +261,5 @@ public static partial class xxHash32
return __inline__XXH32(ptr, length, seed); return __inline__XXH32(ptr, length, seed);
} }
}
} }

View File

@ -2,10 +2,10 @@
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
namespace Standart.Hash.xxHash; namespace Standart.Hash.xxHash
public static partial class xxHash64
{ {
public static partial class xxHash64
{
private static readonly ulong XXH_PRIME64_1 = 11400714785074694791UL; private static readonly ulong XXH_PRIME64_1 = 11400714785074694791UL;
private static readonly ulong XXH_PRIME64_2 = 14029467366897019727UL; private static readonly ulong XXH_PRIME64_2 = 14029467366897019727UL;
private static readonly ulong XXH_PRIME64_3 = 1609587929392839161UL; private static readonly ulong XXH_PRIME64_3 = 1609587929392839161UL;
@ -17,4 +17,5 @@ public static partial class xxHash64
{ {
return (x << r) | (x >> (64 - r)); return (x << r) | (x >> (64 - r));
} }
}
} }

View File

@ -9,10 +9,10 @@ using System.Runtime.InteropServices;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace Standart.Hash.xxHash; namespace Standart.Hash.xxHash
public static partial class xxHash64
{ {
public static partial class xxHash64
{
/// <summary> /// <summary>
/// Compute xxHash for the data byte array /// Compute xxHash for the data byte array
/// </summary> /// </summary>
@ -261,4 +261,6 @@ public static partial class xxHash64
return __inline__XXH64(ptr, length, seed); return __inline__XXH64(ptr, length, seed);
} }
}
} }