I was making a fake encryption program and when trying to convert a string into a int32 and i get the following message System.OverflowException. The error message is at the Convert.ToInt32(textnumbers);
static void encryption(string text)
{
byte[] nums = Encoding.ASCII.GetBytes(text);
int[] en = new int[nums.Length];
for (int i = 0; i < nums.Length; i++)
{
en[i] = nums[i] * 2 + 5;
}
string textnumbers = string.Join("", en);
Console.WriteLine(textnumbers);
int num = Convert.ToInt32(textnumbers);
string hexValue = num.ToString("x");
Console.WriteLine(hexValue);
}
static void Main(string[] args)
{
encryption("abcde");
Console.ReadLine();
}