Skip to content

Commit 071fe7c

Browse files
authored
Use HashCode.AddBytes in CodeHeaderValue.GetHashCode
1 parent 2ed52e4 commit 071fe7c

File tree

1 file changed

+4
-0
lines changed
  • src/libraries/System.Security.Cryptography.Cose/src/System/Security/Cryptography/Cose

1 file changed

+4
-0
lines changed

src/libraries/System.Security.Cryptography.Cose/src/System/Security/Cryptography/Cose/CoseHeaderValue.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,10 +261,14 @@ public int GetValueAsBytes(Span<byte> destination)
261261
public override int GetHashCode()
262262
{
263263
HashCode hashCode = default;
264+
#if NET
265+
hashCode.AddBytes(EncodedValue.Span);
266+
#else
264267
foreach (byte b in EncodedValue.Span)
265268
{
266269
hashCode.Add(b);
267270
}
271+
#endif
268272
return hashCode.ToHashCode();
269273
}
270274

0 commit comments

Comments
 (0)