Base64Encoder icon indicating copy to clipboard operation
Base64Encoder copied to clipboard

Converting base16 FromBase Incorrect

Open kotval opened this issue 6 years ago • 0 comments

Code to Reproduce:

string hexString = "49276d206b696c6c696e6720796f757220627261696e206c696b65206120706f69736f6e6f7573206d757368726f6f6d";
Base16Encoder b16Encoder = new Base16Encoder();
byte[] data = b16Encoder.FromBase(hexString.ToUpper());
foreach(byte b in data) {Console.Write(b + " ");}


Output: Output From Code in Base 10:
16 144 135 24 208 128 24 177 137 24 193 140 24 145 142 24 112 128 28 145 143 28 81 194 8 1 130 28 33 129 24 145 142 8 1 140 24 145 139 24 80 128 24 16 128 28 1 143 24 145 195 24 241 142 24 241 197 28 48 128 24 209 197 28 49 136 28 33 143 24 241 141 
Correct Output in Decimal:
73 39 109 32 107 105 108 108 105 110 103 32 121 111 117 114 32 98 114 97 105 110 32 108 105 107 101 32 97 32 112 111 105 115 111 110 111 117 115 32 109 117 115 104 114 111 111 109```

kotval avatar Jan 19 '19 18:01 kotval