dotnet / dotnet/dotnet-api-docs
Information seems contradictory
- Dominant language
- C#
- Stars
- 949
- Forks
- 1.7k
- Avg merge
- 3d 27m
- Merged PRs (30d)
- 49
Description
Regarding the last information box (emphasis mine).
> Hash codes are used to **insert and retrieve keyed objects from hash tables** efficiently. ... Because of this, you should not serialize or persist hash code values, **nor should you use them as keys in a hash table** or dictionary.
I understand the general information of `GetHashCode()` being randomized so you can't rely on it across program executions etc, but saying hash codes are used to insert values into hash tables, but that you shouldn't use them as keys in a hash table seems contradictory?
---
#### Document Details
⚠ *Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.*
* ID: 46e1d9ef-f477-c47a-da4e-88feb95f6dc9
* Version Independent ID: acedf195-f641-b347-39a9-7b3a43d32e00
* Content: [String.GetHashCode Method (System)](https://docs.microsoft.com/en-us/dotnet/api/system.string.gethashcode?view=netframework-4.7.2)
* Content Source: [xml/System/String.xml](https://github.com/dotnet/dotnet-api-docs/blob/master/xml/System/String.xml)
* Product: **dotnet-api**
* GitHub Login: @dotnet-bot
* Microsoft Alias: **dotnetcontent**
Contributor guide
Assessment
This issue has not been assessed yet.