Skip to content

Commit 182833e

Browse files
authored
Add System.IO.Hashing ref csproj (#77856)
* Add System.IO.Hashing ref csproj * Fix System.IO.Hashing ref source and add sln
1 parent b07a2f2 commit 182833e

4 files changed

Lines changed: 39 additions & 0 deletions

File tree

eng/ApiCompatExcludeAttributes.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ T:System.Diagnostics.CodeAnalysis.MemberNotNullAttribute
22
T:System.Diagnostics.DebuggerGuidedStepThroughAttribute
33
T:System.Runtime.CompilerServices.EagerStaticClassConstructionAttribute
44
T:System.Runtime.CompilerServices.NativeIntegerAttribute
5+
T:System.Runtime.CompilerServices.SkipLocalsInitAttribute

src/libraries/System.IO.Hashing/System.IO.Hashing.sln

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
Microsoft Visual Studio Solution File, Format Version 12.00
22
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestUtilities", "..\Common\tests\TestUtilities\TestUtilities.csproj", "{F94DE827-A426-45CB-AE6E-4E1C154B5386}"
33
EndProject
4+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.IO.Hashing", "ref\System.IO.Hashing.csproj", "{259A1DB6-EF7E-4D45-96EF-035E0605BB55}"
5+
EndProject
46
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.IO.Hashing", "src\System.IO.Hashing.csproj", "{A078A4EB-27E8-42B1-BD44-3807732A4560}"
57
EndProject
68
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", ".
911
EndProject
1012
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}"
1113
EndProject
14+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ref", "ref", "{46BA9FAE-9204-455A-BB2D-518E5B5C3E4C}"
15+
EndProject
1216
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{1E78399D-326B-4C9F-B8A9-A7E684EEA349}"
1317
EndProject
1418
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{F2826BE8-9FA1-40C8-8FD4-E98A4644733E}"
@@ -25,6 +29,10 @@ Global
2529
{F94DE827-A426-45CB-AE6E-4E1C154B5386}.Debug|Any CPU.Build.0 = Debug|Any CPU
2630
{F94DE827-A426-45CB-AE6E-4E1C154B5386}.Release|Any CPU.ActiveCfg = Release|Any CPU
2731
{F94DE827-A426-45CB-AE6E-4E1C154B5386}.Release|Any CPU.Build.0 = Release|Any CPU
32+
{259A1DB6-EF7E-4D45-96EF-035E0605BB55}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
33+
{259A1DB6-EF7E-4D45-96EF-035E0605BB55}.Debug|Any CPU.Build.0 = Debug|Any CPU
34+
{259A1DB6-EF7E-4D45-96EF-035E0605BB55}.Release|Any CPU.ActiveCfg = Release|Any CPU
35+
{259A1DB6-EF7E-4D45-96EF-035E0605BB55}.Release|Any CPU.Build.0 = Release|Any CPU
2836
{A078A4EB-27E8-42B1-BD44-3807732A4560}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
2937
{A078A4EB-27E8-42B1-BD44-3807732A4560}.Debug|Any CPU.Build.0 = Debug|Any CPU
3038
{A078A4EB-27E8-42B1-BD44-3807732A4560}.Release|Any CPU.ActiveCfg = Release|Any CPU
@@ -48,6 +56,7 @@ Global
4856
GlobalSection(NestedProjects) = preSolution
4957
{F94DE827-A426-45CB-AE6E-4E1C154B5386} = {1E78399D-326B-4C9F-B8A9-A7E684EEA349}
5058
{2E6DAC1B-9054-40AF-AF72-4C2DD7BD9294} = {1E78399D-326B-4C9F-B8A9-A7E684EEA349}
59+
{259A1DB6-EF7E-4D45-96EF-035E0605BB55} = {46BA9FAE-9204-455A-BB2D-518E5B5C3E4C}
5160
{A078A4EB-27E8-42B1-BD44-3807732A4560} = {F2826BE8-9FA1-40C8-8FD4-E98A4644733E}
5261
{0EBDAC1E-7132-406B-96B4-F8875A689C99} = {26D7BA38-5978-4423-814C-0C8D9F38C1A3}
5362
{A60C1BBE-8CD7-4B6A-AD3C-FF1209857C39} = {26D7BA38-5978-4423-814C-0C8D9F38C1A3}

src/libraries/System.IO.Hashing/ref/System.IO.Hashing.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,26 @@ public void Append(System.IO.Stream stream) { }
4444
public byte[] GetHashAndReset() { throw null; }
4545
public int GetHashAndReset(System.Span<byte> destination) { throw null; }
4646
protected virtual void GetHashAndResetCore(System.Span<byte> destination) { }
47+
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
48+
[System.ObsoleteAttribute("Use GetCurrentHash() to retrieve the computed hash code.", true)]
4749
public override int GetHashCode() { throw null; }
4850
public abstract void Reset();
4951
public bool TryGetCurrentHash(System.Span<byte> destination, out int bytesWritten) { throw null; }
5052
public bool TryGetHashAndReset(System.Span<byte> destination, out int bytesWritten) { throw null; }
5153
}
54+
public sealed partial class XxHash3 : System.IO.Hashing.NonCryptographicHashAlgorithm
55+
{
56+
public XxHash3() : base (default(int)) { }
57+
public XxHash3(long seed) : base (default(int)) { }
58+
public override void Append(System.ReadOnlySpan<byte> source) { }
59+
protected override void GetCurrentHashCore(System.Span<byte> destination) { }
60+
public static byte[] Hash(byte[] source) { throw null; }
61+
public static byte[] Hash(byte[] source, long seed) { throw null; }
62+
public static byte[] Hash(System.ReadOnlySpan<byte> source, long seed = (long)0) { throw null; }
63+
public static int Hash(System.ReadOnlySpan<byte> source, System.Span<byte> destination, long seed = (long)0) { throw null; }
64+
public override void Reset() { }
65+
public static bool TryHash(System.ReadOnlySpan<byte> source, System.Span<byte> destination, out int bytesWritten, long seed = (long)0) { throw null; }
66+
}
5267
public sealed partial class XxHash32 : System.IO.Hashing.NonCryptographicHashAlgorithm
5368
{
5469
public XxHash32() : base (default(int)) { }
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
<PropertyGroup>
3+
<TargetFrameworks>$(NetCoreAppCurrent);$(NetCoreAppMinimum);netstandard2.0;$(NetFrameworkMinimum)</TargetFrameworks>
4+
<NoWarn>$(NoWarn);CS0809</NoWarn>
5+
</PropertyGroup>
6+
7+
<ItemGroup>
8+
<Compile Include="System.IO.Hashing.cs" />
9+
</ItemGroup>
10+
11+
<ItemGroup Condition="'$(TargetFrameworkIdentifier)' != '.NETCoreApp'">
12+
<PackageReference Include="System.Memory" Version="$(SystemMemoryVersion)" />
13+
</ItemGroup>
14+
</Project>

0 commit comments

Comments
 (0)