This repository has been archived on 2022-08-05. You can view files and clone it, but cannot push or open issues or pull requests.
CC-Functions/Misc/GenericExtensions.cs

31 lines
1.1 KiB
C#

using System;
using System.IO;
using System.IO.Compression;
using System.Linq;
using System.Net;
using CC_Functions.Core;
namespace CC_Functions.Misc
{
/// <summary>
/// Extension methods for various types
/// </summary>
public static class GenericExtensions
{
/// <summary>
/// Extension method for <see cref="Crypto">Crypto's</see> Encrypt
/// </summary>
/// <param name="self">The data to encrypt</param>
/// <param name="key">The key to encrypt with</param>
/// <returns>The encrypted data</returns>
public static byte[] Encrypt(this byte[] self, byte[] key) => Crypto.Encrypt(self, key);
/// <summary>
/// Extension method for <see cref="Crypto">Crypto's</see> Decrypt
/// </summary>
/// <param name="self">The data to decrypt</param>
/// <param name="key">The key to decrypt with</param>
/// <returns>The decrypted data</returns>
public static byte[] Decrypt(this byte[] self, byte[] key) => Crypto.Decrypt(self, key);
}
}