Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit 55f6bec

Browse files
jcdickinsonmorganbr
authored andcommitted
HashCode based on xxHash32 (#14863)
* HashCode based on xxHash32 Works by maintaining the xxHash32 state variables (v1 -> v4, length) as well as a queue of values that fall outside of the block size (16 bytes/4 ints). The seed is initialized to random bytes. Further details, unit tests and history: dotnet/corefx#25013
1 parent 658bc65 commit 55f6bec

File tree

4 files changed

+465
-0
lines changed

4 files changed

+465
-0
lines changed

THIRD-PARTY-NOTICES.TXT

+28
Original file line numberDiff line numberDiff line change
@@ -221,3 +221,31 @@ License notice for the Printing Floating-Point Numbers
221221
3. This notice may not be removed or altered from any source
222222
distribution.
223223
******************************************************************************/
224+
225+
License notice for xxHash
226+
-------------------------
227+
228+
xxHash Library
229+
Copyright (c) 2012-2014, Yann Collet
230+
All rights reserved.
231+
232+
Redistribution and use in source and binary forms, with or without modification,
233+
are permitted provided that the following conditions are met:
234+
235+
* Redistributions of source code must retain the above copyright notice, this
236+
list of conditions and the following disclaimer.
237+
238+
* Redistributions in binary form must reproduce the above copyright notice, this
239+
list of conditions and the following disclaimer in the documentation and/or
240+
other materials provided with the distribution.
241+
242+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
243+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
244+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
245+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
246+
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
247+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
248+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
249+
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
250+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
251+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

src/mscorlib/Resources/Strings.resx

+6
Original file line numberDiff line numberDiff line change
@@ -3691,4 +3691,10 @@
36913691
<data name="Memory_OutstandingReferences" xml:space="preserve">
36923692
<value>Release all references before disposing this instance.</value>
36933693
</data>
3694+
<data name="HashCode_HashCodeNotSupported" xml:space="preserve">
3695+
<value>HashCode is a mutable struct and should not be compared with other HashCodes. Use ToHashCode to retrieve the computed hash code.</value>
3696+
</data>
3697+
<data name="HashCode_EqualityNotSupported" xml:space="preserve">
3698+
<value>HashCode is a mutable struct and should not be compared with other HashCodes.</value>
3699+
</data>
36943700
</root>

src/mscorlib/shared/System.Private.CoreLib.Shared.projitems

+1
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@
159159
<Compile Include="$(MSBuildThisFileDirectory)System\Globalization\UmAlQuraCalendar.cs" />
160160
<Compile Include="$(MSBuildThisFileDirectory)System\Globalization\UnicodeCategory.cs" />
161161
<Compile Include="$(MSBuildThisFileDirectory)System\Guid.cs" />
162+
<Compile Include="$(MSBuildThisFileDirectory)System\HashCode.cs" />
162163
<Compile Include="$(MSBuildThisFileDirectory)System\HResults.cs" />
163164
<Compile Include="$(MSBuildThisFileDirectory)System\IAsyncResult.cs" />
164165
<Compile Include="$(MSBuildThisFileDirectory)System\ICloneable.cs" />

0 commit comments

Comments
 (0)