Base-64 - 6 bits per character (2 ^ 6 = 64).
256 bits / 6 bits per char = 42.6666 char
And that obviously ended up as 44 due to filling out (you'll see one or two =at the end of the output).
You should expect base-16 (AKA hexadecimal), which is 4 bits per character (2 ^ 4 = 16).
256 bits / 4 bits per char = 64 char
For hex use this :
return BitConverter.ToString(bytes).Replace("-", string.Empty);
source
share