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>
<PropertyGroup>
<TargetFrameworks>net5.0;net6.0</TargetFrameworks>
<LangVersion>9.0</LangVersion>
<BenchmarkDotNet>0.13.1</BenchmarkDotNet>
<MicrosoftSdk>17.2.0</MicrosoftSdk>
<xUnit>2.4.1</xUnit>

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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