I'm using code below to convert a list of numbers to a Base64 encoded string.
The problem is that as soon as I try something over 255 I get System.OverflowException since it overflows the byte capacity.
What would be a good way of doing this? There is an example here but I was just wondering if there are other ways of making this work.
private string DecimalToBase64(List<int> lst)
{
byte[] arr = new byte[lst.Count];
for(int i = 0; i < arr.Length; i++)
{
arr[i] = Convert.ToByte(lst[i]);
}
return Convert.ToBase64String(arr);
}