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

Commit

Permalink
HashCode based on xxHash32 (#14863)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
jcdickinson authored and morganbr committed Nov 16, 2017
1 parent 658bc65 commit 55f6bec
Show file tree
Hide file tree
Showing 4 changed files with 465 additions and 0 deletions.
28 changes: 28 additions & 0 deletions THIRD-PARTY-NOTICES.TXT
Original file line number Diff line number Diff line change
Expand Up @@ -221,3 +221,31 @@ License notice for the Printing Floating-Point Numbers
3. This notice may not be removed or altered from any source
distribution.
******************************************************************************/

License notice for xxHash
-------------------------

xxHash Library
Copyright (c) 2012-2014, Yann Collet
All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
6 changes: 6 additions & 0 deletions src/mscorlib/Resources/Strings.resx
Original file line number Diff line number Diff line change
Expand Up @@ -3691,4 +3691,10 @@
<data name="Memory_OutstandingReferences" xml:space="preserve">
<value>Release all references before disposing this instance.</value>
</data>
<data name="HashCode_HashCodeNotSupported" xml:space="preserve">
<value>HashCode is a mutable struct and should not be compared with other HashCodes. Use ToHashCode to retrieve the computed hash code.</value>
</data>
<data name="HashCode_EqualityNotSupported" xml:space="preserve">
<value>HashCode is a mutable struct and should not be compared with other HashCodes.</value>
</data>
</root>
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@
<Compile Include="$(MSBuildThisFileDirectory)System\Globalization\UmAlQuraCalendar.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Globalization\UnicodeCategory.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\Guid.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\HashCode.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\HResults.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\IAsyncResult.cs" />
<Compile Include="$(MSBuildThisFileDirectory)System\ICloneable.cs" />
Expand Down
Loading

0 comments on commit 55f6bec

Please sign in to comment.