File tree 2 files changed +2
-21
lines changed
Security/Authentication/Facebook/src
2 files changed +2
-21
lines changed Original file line number Diff line number Diff line change 2
2
// The .NET Foundation licenses this file to you under the MIT license.
3
3
4
4
using System . Diagnostics ;
5
- using System . Globalization ;
6
5
using System . Runtime . CompilerServices ;
7
6
using System . Security . Cryptography ;
8
- using System . Text ;
9
7
10
8
namespace Microsoft . AspNetCore . Antiforgery ;
11
9
@@ -45,18 +43,7 @@ public int BitLength
45
43
}
46
44
}
47
45
48
- private string DebuggerString
49
- {
50
- get
51
- {
52
- var sb = new StringBuilder ( "0x" , 2 + ( _data . Length * 2 ) ) ;
53
- for ( var i = 0 ; i < _data . Length ; i ++ )
54
- {
55
- sb . AppendFormat ( CultureInfo . InvariantCulture , "{0:x2}" , _data [ i ] ) ;
56
- }
57
- return sb . ToString ( ) ;
58
- }
59
- }
46
+ private string DebuggerString => $ "0x{ Convert . ToHexStringLower ( _data ) } ";
60
47
61
48
public override bool Equals ( object ? obj )
62
49
{
Original file line number Diff line number Diff line change 1
1
// Licensed to the .NET Foundation under one or more agreements.
2
2
// The .NET Foundation licenses this file to you under the MIT license.
3
3
4
- using System . Globalization ;
5
4
using System . Net . Http ;
6
5
using System . Security . Claims ;
7
6
using System . Security . Cryptography ;
@@ -70,12 +69,7 @@ private string GenerateAppSecretProof(string accessToken)
70
69
var key = Encoding . ASCII . GetBytes ( Options . AppSecret ) ;
71
70
var tokenBytes = Encoding . ASCII . GetBytes ( accessToken ) ;
72
71
var hash = HMACSHA256 . HashData ( key , tokenBytes ) ;
73
- var builder = new StringBuilder ( ) ;
74
- for ( int i = 0 ; i < hash . Length ; i ++ )
75
- {
76
- builder . Append ( CultureInfo . InvariantCulture , $ "{ hash [ i ] : x2} ") ;
77
- }
78
- return builder . ToString ( ) ;
72
+ return Convert . ToHexStringLower ( hash ) ;
79
73
}
80
74
81
75
/// <inheritdoc />
You can’t perform that action at this time.
0 commit comments