Skip to content

Commit

Permalink
Removing unnecessary ToArray() (jwt-dotnet#45)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jusfrw authored and abatishchev committed Sep 13, 2016
1 parent 5ff0ed0 commit 3ca275b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions JWT/JWT.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,14 @@ public static string Encode(IDictionary<string, object> extraHeaders, object pay
segments.Add(Base64UrlEncode(headerBytes));
segments.Add(Base64UrlEncode(payloadBytes));

var stringToSign = string.Join(".", segments.ToArray());
var stringToSign = string.Join(".", segments);

var bytesToSign = Encoding.UTF8.GetBytes(stringToSign);

byte[] signature = HashAlgorithms[algorithm](key, bytesToSign);
segments.Add(Base64UrlEncode(signature));

return string.Join(".", segments.ToArray());
return string.Join(".", segments);
}

/// <summary>
Expand Down

0 comments on commit 3ca275b

Please sign in to comment.