package com.secspace.lib.common.cryptology;

import android.util.Base64;

import java.io.UnsupportedEncodingException;

/**
 * Created by bxy on 2019/7/3.
 */

public class BaseUtil {
    public static String encodeToString(String str) {
        try {
            return Base64.encodeToString(str.getBytes("utf-8"), Base64.NO_WRAP);
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        }
        return "";
    }

    public static String decodeToString(String encodeWord) {
        try {
            return new String(Base64.decode(encodeWord, Base64.NO_WRAP), "utf-8");
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        }
        return "";
    }
}
