.Shared.Return(buffer);
}
}
-
+#if NET6_0_OR_GREATER
///
/// Compute xxHash for the data byte span
///
@@ -175,7 +173,7 @@ namespace Standart.Hash.xxHash
return UnsafeComputeHash(pData, length, seed);
}
}
-
+#endif
///
/// Compute xxHash for the stream
///
diff --git a/README.md b/README.md
deleted file mode 100644
index b55ddab..0000000
--- a/README.md
+++ /dev/null
@@ -1,131 +0,0 @@
-
-
-
-
-
-
- Extremely fast non-cryptographic hash algorithm xxhash
-
-
-
-
-
-
-
-
-
-
-
-xxHash is an Extremely fast Hash algorithm, running at RAM speed limits. It successfully completes the **SMHasher** test suite which evaluates collision, dispersion and randomness qualities of hash functions.
-
-## Instalation
-```
-PM> Install-Package Standart.Hash.xxHash
-```
-
-## Benchmarks
-This benchmark was launched on a **Windows 10.0.19044.1706 (21H2)**. The reference system uses a **AMD Ryzen 7 2700, 1 CPU, 16 logical and 8 physical cores**
-```
-BenchmarkDotNet=v0.13.1, OS=Windows 10.0.19044.1706 (21H2)
-AMD Ryzen 7 2700, 1 CPU, 16 logical and 8 physical cores
-.NET SDK=6.0.300
- [Host] : .NET 6.0.5 (6.0.522.21309), X64 RyuJIT
- Job-HQVLOG : .NET 6.0.5 (6.0.522.21309), X64 RyuJIT
-Runtime=.NET 6.0
-```
-
-| Method | x64 |
-|:---------------|-----------:|
-| Hash32 Array | 6.65 GB/s |
-| Hash64 Array | 12.28 GB/s |
-| Hash128 Array | 12.04 GB/s |
-| Hash3 Array | 12.08 GB/s |
-| Hash32 Span | 6.65 GB/s |
-| Hash64 Span | 12.28 GB/s |
-| Hash128 Span | 12.04 GB/s |
-| Hash3 Span | 12.08 GB/s |
-| Hash32 Stream | 3.22 GB/s |
-| Hash64 Stream | 4.81 GB/s |
-
-## Comparison between С# and C implementation
-
-| Method | Platform | Language | 1KB Time | 1MB Time | 1GB Time | Speed |
-|:-------------------|---------:|---------:|----------:|----------:|----------:|-----------:|
-| Hash32 | x64 | C# | 138.0 ns | 130.2 us | 150.3 ms | 6.65 GB/s |
-| Hash32 | x64 | C | 140.2 ns | 129.6 us | 150.3 ms | 6.65 GB/s |
-| Hash64 | x64 | C# | 73.9 ns | 64.6 us | 81.4 ms | 12.28 GB/s |
-| Hash64 | x64 | C | 75.5 ns | 65.2 us | 84.5 ms | 11.83 GB/s |
-| Hash128 (SSE2/AVX2)| x64 | C# | 84.95 ns | 56.9 us | 73.2 ms | 13.66 GB/s |
-| Hash128 (SSE2/AVX2)| x64 | C | 84.35 ns | 38.1 us | 57.2 ms | 17.48 GB/s |
-| Hash3 (SSE2/AVX2)| x64 | C# | 75.8 ns | 56.6 us | 74.6 ms | 13.40 GB/s |
-| Hash3 (SSE2/AVX2)| x64 | C | 74.1 ns | 42.1 us | 59.5 ms | 16.80 GB/s |
-
-
-## Api
-```cs
-public static uint ComputeHash(byte[] data, int length, uint seed = 0) { throw null; }
-public static uint ComputeHash(Span data, int length, uint seed = 0) { throw null; }
-public static uint ComputeHash(Stream stream, int bufferSize = 4096, uint seed = 0) { throw null; }
-public static async ValueTask ComputeHashAsync(Stream stream, int bufferSize = 4096, uint seed = 0) { throw null; }
-public static uint ComputeHash(string str, uint seed = 0) { throw null; }
-
-
-public static ulong ComputeHash(byte[] data, int length, ulong seed = 0) { throw null; }
-public static ulong ComputeHash(Span data, int length, ulong seed = 0) { throw null; }
-public static ulong ComputeHash(Stream stream, int bufferSize = 8192, ulong seed = 0) { throw null; }
-public static async ValueTask ComputeHashAsync(Stream stream, int bufferSize = 8192, ulong seed = 0) { throw null; }
-public static ulong ComputeHash(string str, uint seed = 0) { throw null; }
-
-public static uint128 ComputeHash(byte[] data, int length, uint seed = 0) { throw null; }
-public static uint128 ComputeHash(Span data, int length, uint seed = 0) { throw null; }
-public static uint128 ComputeHash(string str, uint seed = 0) { throw null; }
-
-// allocations
-public static byte[] ComputeHashBytes(byte[] data, int length, uint seed = 0) { throw null; }
-public static byte[] ComputeHashBytes(Span data, int length, uint seed = 0) { throw null; }
-public static byte[] ComputeHashBytes(string str, uint seed = 0) { throw null; }
-
-```
-
-## Examples
-A few examples of how to use api
-```cs
-byte[] data = Encoding.UTF8.GetBytes("veni vidi vici");
-
-ulong h64_1 = xxHash64.ComputeHash(data, data.Length);
-ulong h64_2 = xxHash64.ComputeHash(new Span(data), data.Length);
-ulong h64_3 = xxHash64.ComputeHash(new ReadOnlySpan(data), data.Length);
-ulong h64_4 = xxHash64.ComputeHash(new MemoryStream(data));
-ulong h64_5 = await xxHash64.ComputeHashAsync(new MemoryStream(data));
-ulong h64_6 = xxHash64.ComputeHash("veni vidi vici");
-
-uint h32_1 = xxHash32.ComputeHash(data, data.Length);
-uint h32_2 = xxHash32.ComputeHash(new Span(data), data.Length);
-uint h32_3 = xxHash32.ComputeHash(new ReadOnlySpan(data), data.Length);
-uint h32_4 = xxHash32.ComputeHash(new MemoryStream(data));
-uint h32_5 = await xxHash32.ComputeHashAsync(new MemoryStream(data));
-uint h32_6 = xxHash32.ComputeHash("veni vidi vici");
-
-ulong h3_1 = xxHash3.ComputeHash(data, data.Length);
-ulong h3_2 = xxHash3.ComputeHash(new Span(data), data.Length);
-ulong h3_3 = xxHash3.ComputeHash(new ReadOnlySpan(data), data.Length);
-ulong h3_4 = xxHash3.ComputeHash("veni vidi vici");
-
-uint128 h128_1 = xxHash128.ComputeHash(data, data.Length);
-uint128 h128_2 = xxHash128.ComputeHash(new Span(data), data.Length);
-uint128 h128_3 = xxHash128.ComputeHash(new ReadOnlySpan(data), data.Length);
-uint128 h128_4 = xxHash128.ComputeHash("veni vidi vici");
-
-Guid guid = h128_1.ToGuid();
-byte[] bytes = h128_1.ToBytes();
-
-byte[] hash_bytes_1 = xxHash128.ComputeHashBytes(data, data.Length);
-byte[] hash_bytes_2 = xxHash128.ComputeHashBytes(new Span(data), data.Length);
-byte[] hash_bytes_3 = xxHash128.ComputeHashBytes(new ReadOnlySpan(data), data.Length);
-byte[] hash_bytes_4 = xxHash128.ComputeHashBytes("veni vidi vici");
-
-```
----
-
-Made in :beginner: Ukraine with :heart:
-
diff --git a/deps.props b/deps.props
deleted file mode 100644
index c5ff158..0000000
--- a/deps.props
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
- net5.0;net6.0
- 9.0
- 0.13.1
- 17.2.0
- 2.4.1
- 2.4.5
- 2.3.1
-
-
\ No newline at end of file
diff --git a/nuget.props b/nuget.props
deleted file mode 100644
index 2edde0c..0000000
--- a/nuget.props
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
- Standart.Hash.xxHash
- 4.0.5
- Standart.Hash.xxHash
- Standart.Hash.xxHash
- Oleksandr Melnyk
- hash;xxHash
- Standart.Hash.xxHash
- https://github.com/uranium62/xxHash
- MIT
-
-
\ No newline at end of file
diff --git a/src/Standart.Hash.xxHash.Perf/Standart.Hash.xxHash.Perf.csproj b/src/Standart.Hash.xxHash.Perf/Standart.Hash.xxHash.Perf.csproj
deleted file mode 100644
index e0e03f3..0000000
--- a/src/Standart.Hash.xxHash.Perf/Standart.Hash.xxHash.Perf.csproj
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-
- Exe
-
-
- true
- x64
-
-
- false
- AnyCPU
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/Standart.Hash.xxHash.sln b/src/Standart.Hash.xxHash.sln
deleted file mode 100644
index 7a6119a..0000000
--- a/src/Standart.Hash.xxHash.sln
+++ /dev/null
@@ -1,28 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 12.00
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Standart.Hash.xxHash", "Standart.Hash.xxHash\Standart.Hash.xxHash.csproj", "{E468CD00-D581-46DD-ADE6-71EFA74AD62E}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Standart.Hash.xxHash.Perf", "Standart.Hash.xxHash.Perf\Standart.Hash.xxHash.Perf.csproj", "{7B80269B-1EC4-40B5-8E19-F0A68C4404E5}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Standart.Hash.xxHash.Test", "Standart.Hash.xxHash.Test\Standart.Hash.xxHash.Test.csproj", "{0D9506CC-A6A1-4C0C-8827-9AB958942895}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Any CPU = Debug|Any CPU
- Release|Any CPU = Release|Any CPU
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {E468CD00-D581-46DD-ADE6-71EFA74AD62E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {E468CD00-D581-46DD-ADE6-71EFA74AD62E}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {E468CD00-D581-46DD-ADE6-71EFA74AD62E}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {E468CD00-D581-46DD-ADE6-71EFA74AD62E}.Release|Any CPU.Build.0 = Release|Any CPU
- {7B80269B-1EC4-40B5-8E19-F0A68C4404E5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {7B80269B-1EC4-40B5-8E19-F0A68C4404E5}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {7B80269B-1EC4-40B5-8E19-F0A68C4404E5}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {7B80269B-1EC4-40B5-8E19-F0A68C4404E5}.Release|Any CPU.Build.0 = Release|Any CPU
- {0D9506CC-A6A1-4C0C-8827-9AB958942895}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {0D9506CC-A6A1-4C0C-8827-9AB958942895}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {0D9506CC-A6A1-4C0C-8827-9AB958942895}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {0D9506CC-A6A1-4C0C-8827-9AB958942895}.Release|Any CPU.Build.0 = Release|Any CPU
- EndGlobalSection
-EndGlobal
diff --git a/src/Standart.Hash.xxHash/Standart.Hash.xxHash.csproj b/src/Standart.Hash.xxHash/Standart.Hash.xxHash.csproj
deleted file mode 100644
index 00d92f3..0000000
--- a/src/Standart.Hash.xxHash/Standart.Hash.xxHash.csproj
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
-
-
-
- true
-
-
-
-
-
-
-
-
\ No newline at end of file