Added base64 decode function to the Value Generator (#27835)

This commit is contained in:
League of Poro
2023-08-21 12:05:08 +02:00
committed by GitHub
parent a8b7d4d627
commit d4ae13238e
3 changed files with 66 additions and 1 deletions

View File

@@ -121,6 +121,12 @@ namespace Community.PowerToys.Run.Plugin.ValueGenerator
string content = query.RawUserQuery.Substring(commandIndex + command.Length).Trim();
request = new Base64Request(Encoding.UTF8.GetBytes(content));
}
else if (command.ToLower(null) == "base64d")
{
int commandIndex = query.RawUserQuery.IndexOf(command, StringComparison.InvariantCultureIgnoreCase);
string content = query.RawUserQuery.Substring(commandIndex + command.Length).Trim();
request = new Base64DecodeRequest(content);
}
else
{
throw new FormatException($"Invalid Query: {query.RawUserQuery}");