|
@@ -27,12 +27,12 @@ namespace Encrypter
|
|
|
|
|
|
private void sposob3_encrypt(object sender, RoutedEventArgs e)
|
|
private void sposob3_encrypt(object sender, RoutedEventArgs e)
|
|
{
|
|
{
|
|
- string input = sposob3_input.Text,output="";
|
|
|
|
- foreach (char c in input)
|
|
|
|
- {
|
|
|
|
- output += Encoding.ASCII.GetString(c);
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
|
|
+ Encoding ascii = Encoding.ASCII;
|
|
|
|
+ string input = sposob3_input.Text, output = "";
|
|
|
|
+ Byte[] encodedBytes = ascii.GetBytes(input);
|
|
|
|
+ foreach (Byte b in encodedBytes)
|
|
|
|
+ output += $"{b + input.Length}%^?";
|
|
|
|
+ sposob3_output.Text = output;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|