Updating with .NET 6.0
This commit is contained in:
@@ -46,8 +46,8 @@ namespace System
|
||||
/// <summary>
|
||||
/// Encodes a string to the hexadecimal system (base 16).
|
||||
/// </summary>
|
||||
/// <param name="str"></param>
|
||||
/// <param name="encoding"></param>
|
||||
/// <param name="str">The string to encode hexadecimal.</param>
|
||||
/// <param name="encoding">The text encoding to use (default: <see cref="Encoding.Default"/>)</param>
|
||||
/// <returns></returns>
|
||||
public static string HexEncode(this string str, Encoding encoding = null)
|
||||
{
|
||||
@@ -60,8 +60,8 @@ namespace System
|
||||
/// <summary>
|
||||
/// Decodes a string from the hexadecimal system (base 16).
|
||||
/// </summary>
|
||||
/// <param name="str"></param>
|
||||
/// <param name="encoding"></param>
|
||||
/// <param name="str">The hexadecimal encoded string to decode.</param>
|
||||
/// <param name="encoding">The text encoding to use (default: <see cref="Encoding.Default"/>)</param>
|
||||
/// <returns></returns>
|
||||
public static string HexDecode(this string str, Encoding encoding = null)
|
||||
{
|
||||
@@ -74,8 +74,8 @@ namespace System
|
||||
/// <summary>
|
||||
/// Encodes a string to base64.
|
||||
/// </summary>
|
||||
/// <param name="str"></param>
|
||||
/// <param name="encoding"></param>
|
||||
/// <param name="str">The string to encode with base64.</param>
|
||||
/// <param name="encoding">The text encoding to use (default: <see cref="Encoding.Default"/>)</param>
|
||||
/// <returns></returns>
|
||||
public static string Base64Encode(this string str, Encoding encoding = null)
|
||||
=> Convert.ToBase64String((encoding ?? Encoding.Default).GetBytes(str));
|
||||
@@ -83,8 +83,8 @@ namespace System
|
||||
/// <summary>
|
||||
/// Decodes a string from base64.
|
||||
/// </summary>
|
||||
/// <param name="str"></param>
|
||||
/// <param name="encoding"></param>
|
||||
/// <param name="str">The base64 encoded string to decode.</param>
|
||||
/// <param name="encoding">The text encoding to use (default: <see cref="Encoding.Default"/>)</param>
|
||||
/// <returns></returns>
|
||||
public static string Base64Decode(this string str, Encoding encoding = null)
|
||||
=> (encoding ?? Encoding.Default).GetString(Convert.FromBase64String(str));
|
||||
|
||||
Reference in New Issue
Block a user