StringBuilder

This commit is contained in:
lightbulblighter 2020-05-05 17:44:24 -05:00 committed by GitHub
parent a807b869b5
commit 8ce63bb949
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -22,15 +22,15 @@ public class CryptoRandom : RandomNumberGenerator
public static string DiogenesCrypt(string word) public static string DiogenesCrypt(string word)
{ {
string result = ""; StringBuilder result = new StringBuilder("");
byte[] bytes = Encoding.ASCII.GetBytes(word); byte[] bytes = Encoding.ASCII.GetBytes(word);
foreach (byte singular in bytes) foreach (byte singular in bytes)
{ {
result += Convert.ToChar(0x55 ^ singular); result.Append(Convert.ToChar(0x55 ^ singular));
} }
return result; return result.ToString();
} }
///<param name=”buffer”>An array of bytes to contain random numbers.</param> ///<param name=”buffer”>An array of bytes to contain random numbers.</param>