From a25166ff4f251c0c9e6a743c0d47cc069e72ff2e Mon Sep 17 00:00:00 2001 From: Peter Dettman Date: Sat, 6 Nov 2021 11:14:59 +0700 Subject: Add null-safe GetHashCode --- crypto/src/util/Platform.cs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'crypto') diff --git a/crypto/src/util/Platform.cs b/crypto/src/util/Platform.cs index 6f7a8b17b..547cef3fa 100644 --- a/crypto/src/util/Platform.cs +++ b/crypto/src/util/Platform.cs @@ -165,6 +165,11 @@ namespace Org.BouncyCastle.Utilities } #endif + internal static int GetHashCode(object obj) + { + return null == obj ? 0 : obj.GetHashCode(); + } + internal static string ToLowerInvariant(string s) { #if PORTABLE -- cgit 1.4.1