The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.
UTF8Encoding::GetHashCode Method ()
.NET Framework (current version)
Returns the hash code for the current instance.
Assembly: mscorlib (in mscorlib.dll)
The following example uses the GetHashCode method to return a hash code for UTF8Encoding instances. Notice that the hash code returned by this method depends on the constructor used to create the UTF8Encoding object.
using namespace System; using namespace System::Text; int main() { // Many ways to instantiate a UTF8 encoding. UTF8Encoding^ UTF8a = gcnew UTF8Encoding; Encoding^ UTF8b = Encoding::UTF8; Encoding^ UTF8c = gcnew UTF8Encoding( true,true ); Encoding^ UTF8d = gcnew UTF8Encoding( false,false ); // But not all are the same. Console::WriteLine( UTF8a->GetHashCode() ); Console::WriteLine( UTF8b->GetHashCode() ); Console::WriteLine( UTF8c->GetHashCode() ); Console::WriteLine( UTF8d->GetHashCode() ); }
Universal Windows Platform
Available since 8
.NET Framework
Available since 1.1
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Windows Phone
Available since 8.1
Available since 8
.NET Framework
Available since 1.1
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Windows Phone
Available since 8.1
Show: