package com.qmth.jkserver.util;

import com.qmth.jkserver.constant.SystemConstant;
import com.qmth.jkserver.signature.Constants;

import java.util.Base64;

/**
 * @Description: base64 util
 * @Param:
 * @return:
 * @Author: wangliang
 * @Date: 2020/12/16
 */
public class Base64Util implements Constants {

    public static String encode(byte[] input) {
        return new String(Base64.getEncoder().encode(input), SystemConstant.CHARSET);
    }

    public static byte[] decode(String input) {
        return Base64.getDecoder().decode(input.getBytes(SystemConstant.CHARSET));
    }
}
