namespace MauiTestApp.Extensions;

public static class ByteArrayExtensions
{
    public static byte[] AsBytes(this string str)
    {
        return Array.ConvertAll(str.ToCharArray(), ch => (byte)ch);
    }

    public static string AsString(this byte[] bytes)
    {
        return new string(Array.ConvertAll(bytes, ch => (char)ch));
    }
}