Why is string.GetHashCode() different each time I run my program in .NET Core?

added by DotNetKicks
12/11/2018 10:39:29 AM


This post is part of the second annual C# Advent. Check out the home page for up to 50 C# blog posts in December 2018! In this post I describe a characteristic about GetHashCode() that was new to me until I was bitten by it recently - that calling GetHashCode() on a string gives a different value each time you run the program in .NET Core!