6 Commits
1.4.2 ... 1.5.0

Author SHA1 Message Date
Matt Nadareski
fd612f939a Bump version 2025-07-24 08:44:08 -04:00
Matt Nadareski
8e3a0f77e9 Be consistent about end-of-file newlines 2025-07-24 08:41:37 -04:00
Matt Nadareski
40cfa78be4 Add .NET Standard 2.0 and 2.1 2025-07-24 08:36:34 -04:00
Matt Nadareski
4d92c7cd23 Update nuget packages 2025-07-24 08:34:59 -04:00
Matt Nadareski
acf1e3ec71 Reduce target frameworks for test project 2025-02-25 21:28:49 -05:00
Matt Nadareski
10027f78e3 Fix how conditions are used for references 2025-02-25 21:24:38 -05:00
63 changed files with 90 additions and 92 deletions

View File

@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net462;net472;net48;net6.0;net7.0;net8.0;net9.0</TargetFrameworks>
<TargetFrameworks>net8.0;net9.0</TargetFrameworks>
<CheckEolTargetFramework>false</CheckEolTargetFramework>
<IsPackable>false</IsPackable>
<LangVersion>latest</LangVersion>
@@ -20,14 +20,14 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="coverlet.collector" Version="6.0.2">
<PackageReference Include="coverlet.collector" Version="6.0.4">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
<PackageReference Include="System.IO.Compression" Version="4.3.0" />
<PackageReference Include="xunit" Version="2.9.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
<PackageReference Include="xunit" Version="2.9.3" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.3">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>

View File

@@ -136,9 +136,9 @@ namespace SabreTools.Hashing.Checksum
/// <inheritdoc/>
protected override byte[] HashFinal()
{
byte[] hashArr = BitConverter.GetBytes(_hash);
byte[] hashArr = BitConverter.GetBytes(_hash);
Array.Reverse(hashArr);
return hashArr;
}
}
}
}

View File

@@ -19,4 +19,4 @@ namespace SabreTools.Hashing.Checksum
return bytes;
}
}
}
}

View File

@@ -47,4 +47,4 @@ namespace SabreTools.Hashing.Checksum
return hashArr;
}
}
}
}

View File

@@ -30,4 +30,4 @@ namespace SabreTools.Hashing.Checksum
#endregion
}
}
}

View File

@@ -56,4 +56,4 @@ namespace SabreTools.Hashing.Checksum
return BitOperations.ClampValueToBytes(localHash, Def.Width);
}
}
}
}

View File

@@ -62,4 +62,4 @@ namespace SabreTools.Hashing.Checksum
/// </summary>
public ulong XorOut { get; set; }
}
}
}

View File

@@ -330,4 +330,4 @@ namespace SabreTools.Hashing.Checksum
hash = local;
}
}
}
}

View File

@@ -41,4 +41,4 @@ namespace SabreTools.Hashing.Checksum
_hash = (ushort)((c1 << 8) | c0);
}
}
}
}

View File

@@ -125,4 +125,4 @@ namespace SabreTools.Hashing.Checksum
_hash = (c1 << 16) | c0;
}
}
}
}

View File

@@ -125,4 +125,4 @@ namespace SabreTools.Hashing.Checksum
_hash = (c1 << 32) | c0;
}
}
}
}

View File

@@ -1687,4 +1687,4 @@ namespace SabreTools.Hashing.Checksum
#endregion
}
}
}

View File

@@ -19,4 +19,4 @@ namespace SabreTools.Hashing
#endregion
}
}
}

View File

@@ -694,4 +694,4 @@ namespace SabreTools.Hashing.CryptographicHash
#endregion
}
}
}

View File

@@ -126,7 +126,7 @@ namespace SabreTools.Hashing.CryptographicHash
// Pad the block
byte[] padding = new byte[padLength];
#if NETFRAMEWORK
#if NETFRAMEWORK || NETSTANDARD2_0
for (int i = 0; i < padLength; i++)
{
padding[i] = padLength;
@@ -166,4 +166,4 @@ namespace SabreTools.Hashing.CryptographicHash
}
}
}
}
}

View File

@@ -211,4 +211,4 @@ namespace SabreTools.Hashing.CryptographicHash
/// </summary>
private static uint H(uint x, uint y, uint z) => x ^ y ^ z;
}
}
}

View File

@@ -59,4 +59,4 @@ namespace SabreTools.Hashing.CryptographicHash
Array.Clear(_block, 0, _block.Length);
}
}
}
}

View File

@@ -444,4 +444,4 @@ namespace SabreTools.Hashing.CryptographicHash
/// </summary>
private static uint G48_63(uint x, uint y, uint z) => (x & z) | (y & ~z);
}
}
}

View File

@@ -680,4 +680,4 @@ namespace SabreTools.Hashing.CryptographicHash
/// </summary>
private static uint G64_79(uint x, uint y, uint z) => x ^ (y | ~z);
}
}
}

View File

@@ -464,4 +464,4 @@ namespace SabreTools.Hashing.CryptographicHash
/// </summary>
private static uint G48_63(uint x, uint y, uint z) => (x & z) | (y & ~z);
}
}
}

View File

@@ -705,4 +705,4 @@ namespace SabreTools.Hashing.CryptographicHash
/// </summary>
private static uint G64_79(uint x, uint y, uint z) => x ^ (y | ~z);
}
}
}

View File

@@ -25,4 +25,4 @@ namespace SabreTools.Hashing.CryptographicHash
return trimmedHash;
}
}
}
}

View File

@@ -25,4 +25,4 @@ namespace SabreTools.Hashing.CryptographicHash
return trimmedHash;
}
}
}
}

View File

@@ -25,4 +25,4 @@ namespace SabreTools.Hashing.CryptographicHash
return trimmedHash;
}
}
}
}

View File

@@ -25,4 +25,4 @@ namespace SabreTools.Hashing.CryptographicHash
return trimmedHash;
}
}
}
}

View File

@@ -14,4 +14,4 @@ namespace SabreTools.Hashing.CryptographicHash
_padStart = 0x01;
}
}
}
}

View File

@@ -14,4 +14,4 @@ namespace SabreTools.Hashing.CryptographicHash
_padStart = 0x01;
}
}
}
}

View File

@@ -25,4 +25,4 @@ namespace SabreTools.Hashing.CryptographicHash
return trimmedHash;
}
}
}
}

View File

@@ -25,4 +25,4 @@ namespace SabreTools.Hashing.CryptographicHash
return trimmedHash;
}
}
}
}

View File

@@ -25,4 +25,4 @@ namespace SabreTools.Hashing.CryptographicHash
return trimmedHash;
}
}
}
}

View File

@@ -25,4 +25,4 @@ namespace SabreTools.Hashing.CryptographicHash
return trimmedHash;
}
}
}
}

View File

@@ -14,4 +14,4 @@ namespace SabreTools.Hashing.CryptographicHash
_padStart = 0x80;
}
}
}
}

View File

@@ -14,4 +14,4 @@ namespace SabreTools.Hashing.CryptographicHash
_padStart = 0x80;
}
}
}
}

View File

@@ -234,4 +234,4 @@ namespace SabreTools.Hashing.CryptographicHash
_block[7] -= _block[6] ^ 0x0123456789ABCDEF;
}
}
}
}

View File

@@ -178,4 +178,4 @@ namespace SabreTools.Hashing
#endregion
}
}
}

View File

@@ -1,7 +1,7 @@
using System;
using System.Collections.Generic;
using System.IO;
#if NET40_OR_GREATER || NETCOREAPP
#if NET40_OR_GREATER || NETCOREAPP || NETSTANDARD2_0_OR_GREATER
using System.Threading.Tasks;
#endif
@@ -753,4 +753,4 @@ namespace SabreTools.Hashing
#endregion
}
}
}

View File

@@ -947,4 +947,4 @@ namespace SabreTools.Hashing
#endregion
}
}
}

View File

@@ -373,4 +373,4 @@ namespace SabreTools.Hashing
#endregion
}
}
}

View File

@@ -40,4 +40,4 @@ namespace SabreTools.Hashing.NonCryptographicHash
#endregion
}
}
}

View File

@@ -23,4 +23,4 @@ namespace SabreTools.Hashing.NonCryptographicHash
}
}
}
}
}

View File

@@ -23,4 +23,4 @@ namespace SabreTools.Hashing.NonCryptographicHash
}
}
}
}
}

View File

@@ -23,4 +23,4 @@ namespace SabreTools.Hashing.NonCryptographicHash
}
}
}
}
}

View File

@@ -23,4 +23,4 @@ namespace SabreTools.Hashing.NonCryptographicHash
}
}
}
}
}

View File

@@ -23,4 +23,4 @@ namespace SabreTools.Hashing.NonCryptographicHash
}
}
}
}
}

View File

@@ -23,4 +23,4 @@ namespace SabreTools.Hashing.NonCryptographicHash
}
}
}
}
}

View File

@@ -57,4 +57,4 @@ namespace SabreTools.Hashing.NonCryptographicHash
return hashArr;
}
}
}
}

View File

@@ -43,4 +43,4 @@ namespace SabreTools.Hashing.NonCryptographicHash
return hashArr;
}
}
}
}

View File

@@ -147,7 +147,7 @@ namespace SabreTools.Hashing.NonCryptographicHash
private static uint Round(uint acc, uint input)
{
acc += input * XXH_PRIME32_2;
acc = RotateLeft32(acc, 13);
acc = RotateLeft32(acc, 13);
acc *= XXH_PRIME32_1;
return acc;
}
@@ -201,4 +201,4 @@ namespace SabreTools.Hashing.NonCryptographicHash
return Avalanche(hash);
}
}
}
}

View File

@@ -43,4 +43,4 @@ namespace SabreTools.Hashing.NonCryptographicHash
return hashArr;
}
}
}
}

View File

@@ -144,7 +144,7 @@ namespace SabreTools.Hashing.NonCryptographicHash
private static ulong Round(ulong acc, ulong input)
{
acc += unchecked(input * XXH_PRIME64_2);
acc = RotateLeft64(acc, 31);
acc = RotateLeft64(acc, 31);
acc *= XXH_PRIME64_1;
return acc;
}
@@ -199,7 +199,7 @@ namespace SabreTools.Hashing.NonCryptographicHash
return Avalanche(hash);
}
/// <summary>
/// Mixes all bits to finalize the hash.
///
@@ -216,4 +216,4 @@ namespace SabreTools.Hashing.NonCryptographicHash
return hash;
}
}
}
}

View File

@@ -1,8 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<!-- Assembly Properties -->
<TargetFrameworks>net20;net35;net40;net452;net462;net472;net48;netcoreapp3.1;net5.0;net6.0;net7.0;net8.0;net9.0</TargetFrameworks>
<TargetFrameworks>net20;net35;net40;net452;net462;net472;net48;netcoreapp3.1;net5.0;net6.0;net7.0;net8.0;net9.0;netstandard2.0;netstandard2.1</TargetFrameworks>
<CheckEolTargetFramework>false</CheckEolTargetFramework>
<IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>
<IncludeSymbols>true</IncludeSymbols>
@@ -11,7 +11,7 @@
<SuppressTfmSupportBuildWarnings>true</SuppressTfmSupportBuildWarnings>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<Version>1.4.2</Version>
<Version>1.5.0</Version>
<!-- Package Properties -->
<Authors>Matt Nadareski</Authors>
@@ -28,12 +28,10 @@
<None Include="../README.md" Pack="true" PackagePath="" />
</ItemGroup>
<!-- Support for old .NET versions -->
<ItemGroup Condition="!$(TargetFramework.StartsWith(`net2`)) AND !$(TargetFramework.StartsWith(`net3`)) AND !$(TargetFramework.StartsWith(`net40`)) AND !$(TargetFramework.StartsWith(`net45`))">
<PackageReference Include="System.IO.Hashing" Version="8.0.0" />
</ItemGroup>
<ItemGroup Condition="$(TargetFramework.StartsWith(`net7`)) OR $(TargetFramework.StartsWith(`net8`)) OR $(TargetFramework.StartsWith(`net9`))">
<PackageReference Include="Blake3" Version="1.1.0" />
<ItemGroup>
<PackageReference Include="Blake3" Version="1.1.0" Condition="$(TargetFramework.StartsWith(`net7`))" />
<PackageReference Include="Blake3" Version="2.0.0" Condition="$(TargetFramework.StartsWith(`net8`)) OR $(TargetFramework.StartsWith(`net9`))" />
<PackageReference Include="System.IO.Hashing" Version="9.0.7" Condition="!$(TargetFramework.StartsWith(`net2`)) AND !$(TargetFramework.StartsWith(`net3`)) AND !$(TargetFramework.StartsWith(`net40`)) AND !$(TargetFramework.StartsWith(`net45`))" />
</ItemGroup>
</Project>

View File

@@ -42,4 +42,4 @@ namespace SabreTools.Hashing.SpamSum
Digest = new byte[SPAMSUM_LENGTH];
}
}
}
}

View File

@@ -443,4 +443,4 @@ namespace SabreTools.Hashing.SpamSum
#endregion
}
}
}

View File

@@ -63,7 +63,7 @@ namespace SabreTools.Hashing.SpamSum
LastH = BH[obh].H;
}
}
public void TryReduceBlockhash()
{
if (BHStart >= BHEnd)
@@ -88,4 +88,4 @@ namespace SabreTools.Hashing.SpamSum
RollMask = RollMask * 2 + 1;
}
}
}
}

View File

@@ -47,10 +47,10 @@ namespace SabreTools.Hashing.SpamSum
H3 <<= 5;
H3 ^= c;
}
/// <summary>
/// Return the current rolling sum
/// </summary>
public uint RollSum() => H1 + H2 + H3;
}
}
}

View File

@@ -353,4 +353,4 @@ namespace SabreTools.Hashing.SpamSum
return n;
}
}
}
}

View File

@@ -67,4 +67,4 @@ namespace SabreTools.Hashing.XxHash
#endregion
}
}
}

View File

@@ -71,4 +71,4 @@ namespace SabreTools.Hashing.XxHash
/// </summary>
XXH_SVE = 6,
}
}
}

View File

@@ -249,4 +249,4 @@ namespace SabreTools.Hashing.XxHash
#endregion
}
}
}

View File

@@ -3,7 +3,7 @@ namespace SabreTools.Hashing.XxHash
internal class XXH3_128Hash
{
public ulong Low { get; set; }
public ulong High { get; set; }
}
}
}

View File

@@ -1,9 +1,9 @@
namespace SabreTools.Hashing.XxHash
{
// Handle unused private fields
#pragma warning disable CS0169
#pragma warning disable CS0414
#pragma warning disable CS0649
#pragma warning disable CS0169
#pragma warning disable CS0414
#pragma warning disable CS0649
/// <summary>
/// Structure for XXH3 streaming API.
@@ -106,7 +106,7 @@ namespace SabreTools.Hashing.XxHash
{
// TODO: XXH3_128bits_reset_withSecret
}
/// <summary>
/// Hash a block of data and append it to the existing hash
/// </summary>
@@ -128,4 +128,4 @@ namespace SabreTools.Hashing.XxHash
return ulong.MaxValue;
}
}
}
}

View File

@@ -1,9 +1,9 @@
namespace SabreTools.Hashing.XxHash
{
// Handle unused private fields
#pragma warning disable CS0169
#pragma warning disable CS0414
#pragma warning disable CS0649
#pragma warning disable CS0169
#pragma warning disable CS0414
#pragma warning disable CS0649
/// <summary>
/// Structure for XXH3 streaming API.
@@ -111,7 +111,7 @@ namespace SabreTools.Hashing.XxHash
{
// TODO: XXH3_64bits_reset_withSecret
}
/// <summary>
/// Hash a block of data and append it to the existing hash
/// </summary>
@@ -133,4 +133,4 @@ namespace SabreTools.Hashing.XxHash
return ulong.MaxValue;
}
}
}
}

View File

@@ -620,4 +620,4 @@ namespace SabreTools.Hashing
return _strings[hashType];
}
}
}
}