【发布时间】:2011-06-30 21:46:17
【问题描述】:
可能重复:
What is the best algorithm for an overridden System.Object.GetHashCode?
我需要为由三个字符串组成的类型覆盖 GetHashCode 方法。这是我的代码:
protected override int GetHashCode()
{
return str1.GetHashCode() + str2.GetHashCode() + str3.GetHashCode();
}
这种方法实现的安全方式是什么?
【问题讨论】: