diff --git a/src/libraries/Common/src/System/HexConverter.cs b/src/libraries/Common/src/System/HexConverter.cs index d0cd3f074dc00..836145c73d71f 100644 --- a/src/libraries/Common/src/System/HexConverter.cs +++ b/src/libraries/Common/src/System/HexConverter.cs @@ -83,6 +83,7 @@ public static void ToCharsBuffer(byte value, Span buffer, int startingInde buffer[startingIndex] = (char)(packedResult >> 8); } + [MethodImpl(MethodImplOptions.AggressiveInlining)] public static void EncodeToUtf16(ReadOnlySpan bytes, Span chars, Casing casing = Casing.Upper) { Debug.Assert(chars.Length >= bytes.Length * 2); diff --git a/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/PhysicalAddress.cs b/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/PhysicalAddress.cs index f2203d56bfe08..ac4cfb0ffcc18 100644 --- a/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/PhysicalAddress.cs +++ b/src/libraries/System.Net.NetworkInformation/src/System/Net/NetworkInformation/PhysicalAddress.cs @@ -90,7 +90,7 @@ public override bool Equals(object? comparand) public override string ToString() { - return Convert.ToHexString(_address.AsSpan()); + return HexConverter.ToString(_address.AsSpan(), HexConverter.Casing.Upper); } public byte[] GetAddressBytes()