Skip to content

Commit

Permalink
feat(shared): add string utils
Browse files Browse the repository at this point in the history
Add utilities to convert a string to base64 and vice versa
  • Loading branch information
CarlosPavajeau committed Jun 8, 2021
1 parent ff8f2e8 commit 71ece50
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/Shared/Domain/Utils.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using System;
using System.Text;

namespace Armory.Shared.Domain
{
public static class Utils
{
public static string StringToBase64(string str)
{
return Convert.ToBase64String(Encoding.UTF8.GetBytes(str));
}

public static string Base64ToString(string str)
{
return Encoding.UTF8.GetString(Convert.FromBase64String(str));
}
}
}

0 comments on commit 71ece50

Please sign in to comment.