Ono to pres tridu Encoding fungovalo, ale az do doby kdy tam byla 0, pri vypisu takoveho stringu text v tomto miste konci.
Uz to mam vyreseny takto:
Kód:
public static string ToHexString(byte{} bytes) // prevede pole na string typu "7A,FF,8B..."
{
char{} chars = new char{bytes.Length * 3};
for (int i = 0; i < bytes.Length; i++)
{
int b = bytes{i};
chars{i * 3} = hexDigits{b >> 4};
chars{i * 3 + 1} = hexDigits{b & 0xF};
chars{i * 3 + 2} = ',';
}
return new string(chars);
}
static char{} hexDigits = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'};