diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2021-08-08 19:53:08 +0700 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2021-08-08 19:53:08 +0700 |
commit | c6acb967e9657080df5cd9ec434323f0b4a6b2df (patch) | |
tree | f1094760287768bba38c1a92fed795d89cfdef55 /crypto/src/util/Arrays.cs | |
parent | Cleanup after bc-fips-csharp updates (diff) | |
download | BouncyCastle.NET-ed25519-c6acb967e9657080df5cd9ec434323f0b4a6b2df.tar.xz |
Add missing GetHashCode variant
Diffstat (limited to 'crypto/src/util/Arrays.cs')
-rw-r--r-- | crypto/src/util/Arrays.cs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/crypto/src/util/Arrays.cs b/crypto/src/util/Arrays.cs index fdf08a90c..86848af8d 100644 --- a/crypto/src/util/Arrays.cs +++ b/crypto/src/util/Arrays.cs @@ -362,6 +362,24 @@ namespace Org.BouncyCastle.Utilities return hc; } + [CLSCompliantAttribute(false)] + public static int GetHashCode(ushort[] data) + { + if (data == null) + return 0; + + int i = data.Length; + int hc = i + 1; + + while (--i >= 0) + { + hc *= 257; + hc ^= data[i]; + } + + return hc; + } + public static int GetHashCode(int[] data, int off, int len) { if (data == null) |