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#
Raw Normal View History

2019-11-29 21:42:39 +01:00
using System;
2020-01-10 16:58:48 +01:00
using System.IO;
2020-03-13 19:19:55 +01:00
using System.IO.Compression;
2019-11-29 21:42:39 +01:00
using System.Linq;
2020-03-13 19:19:55 +01:00
using System.Net;
2020-09-11 10:38:55 +02:00
using CC_Functions.Core;
2019-11-29 21:42:39 +01:00
namespace CC_Functions.Misc
{
/// <summary>
/// Extension methods for various types
/// </summary>
2019-11-29 21:42:39 +01:00
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>
2020-04-03 17:32:22 +02:00
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>
2020-04-03 17:32:22 +02:00
public static byte[] Decrypt(this byte[] self, byte[] key) => Crypto.Decrypt(self, key);
2019-11-29 21:42:39 +01:00
}
}