Created
August 22, 2017 07:15
-
-
Save bayotop/657097a72ca9a1fe2f3307d6e06fa008 to your computer and use it in GitHub Desktop.
Unsafe default behavior of Encoding.UTF8.GetBytes()
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
string secret = "\ud8ab"; | |
string secret2 = "\ud8cd"; | |
if (!secret.Equals(secret2)) | |
{ | |
Console.Out.WriteLine("The strings are not equal."); | |
} | |
computeSignature(secret, "timestamp", "payload"); // returns 1eba7aac5f10ee7aa985722256aa4125e8e59fe256386c8ab10295063d986e57 | |
computeSignature(secret2, "timestamp", "payload"); // returns 1eba7aac5f10ee7aa985722256aa4125e8e59fe256386c8ab10295063d986e57 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment