From b73b9f028e9faf34e64886f001a5c816db56a4a8 Mon Sep 17 00:00:00 2001 From: Stephen Toub Date: Thu, 3 Nov 2022 15:41:17 -0400 Subject: [PATCH 1/2] Add System.IO.Hashing ref csproj --- .../System.IO.Hashing/ref/System.IO.Hashing.csproj | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 src/libraries/System.IO.Hashing/ref/System.IO.Hashing.csproj diff --git a/src/libraries/System.IO.Hashing/ref/System.IO.Hashing.csproj b/src/libraries/System.IO.Hashing/ref/System.IO.Hashing.csproj new file mode 100644 index 00000000000000..824a2952352c69 --- /dev/null +++ b/src/libraries/System.IO.Hashing/ref/System.IO.Hashing.csproj @@ -0,0 +1,13 @@ + + + $(NetCoreAppCurrent);$(NetCoreAppMinimum);netstandard2.0;$(NetFrameworkMinimum) + + + + + + + + + + From bbf59db9dc2584b36df68803eb370b8c89f41a2a Mon Sep 17 00:00:00 2001 From: Stephen Toub Date: Thu, 3 Nov 2022 16:10:31 -0400 Subject: [PATCH 2/2] Fix System.IO.Hashing ref source and add sln --- eng/ApiCompatExcludeAttributes.txt | 1 + .../System.IO.Hashing/System.IO.Hashing.sln | 9 +++++++++ .../System.IO.Hashing/ref/System.IO.Hashing.cs | 15 +++++++++++++++ .../ref/System.IO.Hashing.csproj | 1 + 4 files changed, 26 insertions(+) diff --git a/eng/ApiCompatExcludeAttributes.txt b/eng/ApiCompatExcludeAttributes.txt index 325c9fa1f934a4..47a7794ba9fe41 100644 --- a/eng/ApiCompatExcludeAttributes.txt +++ b/eng/ApiCompatExcludeAttributes.txt @@ -2,3 +2,4 @@ T:System.Diagnostics.CodeAnalysis.MemberNotNullAttribute T:System.Diagnostics.DebuggerGuidedStepThroughAttribute T:System.Runtime.CompilerServices.EagerStaticClassConstructionAttribute T:System.Runtime.CompilerServices.NativeIntegerAttribute +T:System.Runtime.CompilerServices.SkipLocalsInitAttribute diff --git a/src/libraries/System.IO.Hashing/System.IO.Hashing.sln b/src/libraries/System.IO.Hashing/System.IO.Hashing.sln index 57d5526d0c55c6..1c433c1d78a0f1 100644 --- a/src/libraries/System.IO.Hashing/System.IO.Hashing.sln +++ b/src/libraries/System.IO.Hashing/System.IO.Hashing.sln @@ -1,6 +1,8 @@ Microsoft Visual Studio Solution File, Format Version 12.00 Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestUtilities", "..\Common\tests\TestUtilities\TestUtilities.csproj", "{F94DE827-A426-45CB-AE6E-4E1C154B5386}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.IO.Hashing", "ref\System.IO.Hashing.csproj", "{259A1DB6-EF7E-4D45-96EF-035E0605BB55}" +EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.IO.Hashing", "src\System.IO.Hashing.csproj", "{A078A4EB-27E8-42B1-BD44-3807732A4560}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.IO.Hashing.Tests", "tests\System.IO.Hashing.Tests.csproj", "{2E6DAC1B-9054-40AF-AF72-4C2DD7BD9294}" @@ -9,6 +11,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LibraryImportGenerator", ". EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Interop.SourceGeneration", "..\System.Runtime.InteropServices\gen\Microsoft.Interop.SourceGeneration\Microsoft.Interop.SourceGeneration.csproj", "{A60C1BBE-8CD7-4B6A-AD3C-FF1209857C39}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ref", "ref", "{46BA9FAE-9204-455A-BB2D-518E5B5C3E4C}" +EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{1E78399D-326B-4C9F-B8A9-A7E684EEA349}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{F2826BE8-9FA1-40C8-8FD4-E98A4644733E}" @@ -25,6 +29,10 @@ Global {F94DE827-A426-45CB-AE6E-4E1C154B5386}.Debug|Any CPU.Build.0 = Debug|Any CPU {F94DE827-A426-45CB-AE6E-4E1C154B5386}.Release|Any CPU.ActiveCfg = Release|Any CPU {F94DE827-A426-45CB-AE6E-4E1C154B5386}.Release|Any CPU.Build.0 = Release|Any CPU + {259A1DB6-EF7E-4D45-96EF-035E0605BB55}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {259A1DB6-EF7E-4D45-96EF-035E0605BB55}.Debug|Any CPU.Build.0 = Debug|Any CPU + {259A1DB6-EF7E-4D45-96EF-035E0605BB55}.Release|Any CPU.ActiveCfg = Release|Any CPU + {259A1DB6-EF7E-4D45-96EF-035E0605BB55}.Release|Any CPU.Build.0 = Release|Any CPU {A078A4EB-27E8-42B1-BD44-3807732A4560}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {A078A4EB-27E8-42B1-BD44-3807732A4560}.Debug|Any CPU.Build.0 = Debug|Any CPU {A078A4EB-27E8-42B1-BD44-3807732A4560}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -48,6 +56,7 @@ Global GlobalSection(NestedProjects) = preSolution {F94DE827-A426-45CB-AE6E-4E1C154B5386} = {1E78399D-326B-4C9F-B8A9-A7E684EEA349} {2E6DAC1B-9054-40AF-AF72-4C2DD7BD9294} = {1E78399D-326B-4C9F-B8A9-A7E684EEA349} + {259A1DB6-EF7E-4D45-96EF-035E0605BB55} = {46BA9FAE-9204-455A-BB2D-518E5B5C3E4C} {A078A4EB-27E8-42B1-BD44-3807732A4560} = {F2826BE8-9FA1-40C8-8FD4-E98A4644733E} {0EBDAC1E-7132-406B-96B4-F8875A689C99} = {26D7BA38-5978-4423-814C-0C8D9F38C1A3} {A60C1BBE-8CD7-4B6A-AD3C-FF1209857C39} = {26D7BA38-5978-4423-814C-0C8D9F38C1A3} diff --git a/src/libraries/System.IO.Hashing/ref/System.IO.Hashing.cs b/src/libraries/System.IO.Hashing/ref/System.IO.Hashing.cs index 2e103aeac0339f..430f12ef53ae0d 100644 --- a/src/libraries/System.IO.Hashing/ref/System.IO.Hashing.cs +++ b/src/libraries/System.IO.Hashing/ref/System.IO.Hashing.cs @@ -44,11 +44,26 @@ public void Append(System.IO.Stream stream) { } public byte[] GetHashAndReset() { throw null; } public int GetHashAndReset(System.Span destination) { throw null; } protected virtual void GetHashAndResetCore(System.Span destination) { } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + [System.ObsoleteAttribute("Use GetCurrentHash() to retrieve the computed hash code.", true)] public override int GetHashCode() { throw null; } public abstract void Reset(); public bool TryGetCurrentHash(System.Span destination, out int bytesWritten) { throw null; } public bool TryGetHashAndReset(System.Span destination, out int bytesWritten) { throw null; } } + public sealed partial class XxHash3 : System.IO.Hashing.NonCryptographicHashAlgorithm + { + public XxHash3() : base (default(int)) { } + public XxHash3(long seed) : base (default(int)) { } + public override void Append(System.ReadOnlySpan source) { } + protected override void GetCurrentHashCore(System.Span destination) { } + public static byte[] Hash(byte[] source) { throw null; } + public static byte[] Hash(byte[] source, long seed) { throw null; } + public static byte[] Hash(System.ReadOnlySpan source, long seed = (long)0) { throw null; } + public static int Hash(System.ReadOnlySpan source, System.Span destination, long seed = (long)0) { throw null; } + public override void Reset() { } + public static bool TryHash(System.ReadOnlySpan source, System.Span destination, out int bytesWritten, long seed = (long)0) { throw null; } + } public sealed partial class XxHash32 : System.IO.Hashing.NonCryptographicHashAlgorithm { public XxHash32() : base (default(int)) { } diff --git a/src/libraries/System.IO.Hashing/ref/System.IO.Hashing.csproj b/src/libraries/System.IO.Hashing/ref/System.IO.Hashing.csproj index 824a2952352c69..ddc1732ad255d1 100644 --- a/src/libraries/System.IO.Hashing/ref/System.IO.Hashing.csproj +++ b/src/libraries/System.IO.Hashing/ref/System.IO.Hashing.csproj @@ -1,6 +1,7 @@ $(NetCoreAppCurrent);$(NetCoreAppMinimum);netstandard2.0;$(NetFrameworkMinimum) + $(NoWarn);CS0809