Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
stevehjohn committed Jan 13, 2024
1 parent a2d3856 commit be969a6
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Security.Tests/CustomEncoding/Base16EncoderTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public void SetUp()
[TestCase(new byte[] { 128 }, "MA")]
public void GetString_encodes_bytes_correctly(byte[] input, string expected)
{
Assert.That(_encoder.GetString(input), Is.EqualTo(expected));
Assert.That(_encoder.GetString(input).ToUpper(), Is.EqualTo(expected));
}

[TestCase("AC", new byte[] { 1 })]
Expand Down
2 changes: 1 addition & 1 deletion src/Security.Tests/CustomEncoding/EncoderTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public class EncoderTests
[Test]
public void Base16_property_returns_correct_encoder()
{
Assert.That(Encoder.Base16.GetString(new byte[] { 1, 2, 4, 8, 16, 32, 64, 128}), Is.EqualTo("ACADAGAMCADAGAMA"));
Assert.That(Encoder.Base16.GetString(new byte[] { 1, 2, 4, 8, 16, 32, 64, 128}).ToUpper(), Is.EqualTo("ACADAGAMCADAGAMA"));
}
}
}
2 changes: 1 addition & 1 deletion src/Security/CustomEncoding/Base16Encoder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public byte[] GetBytes(string data)

foreach (var c in data)
{
var index = Alphabet.IndexOf(c);
var index = Alphabet.IndexOf(char.ToUpper(c));

result[i / 2] |= i % 2 != 1
? (byte) (index << 4)
Expand Down

0 comments on commit be969a6

Please sign in to comment.