com.ideaaedi.commonds.security.Base64 Maven / Gradle / Ivy
The newest version!
package com.ideaaedi.commonds.security;
import lombok.experimental.UtilityClass;
import javax.annotation.concurrent.ThreadSafe;
/**
* (non-javadoc)
*
* @author JustryDeng
* @since 1.0.0
*/
@ThreadSafe
@UtilityClass
public class Base64 {
/**
* base64#encode
*/
public static String encode(byte[] bytes) {
return java.util.Base64.getEncoder().encodeToString(bytes);
}
/**
* base64#decode
*/
public static byte[] decode(String str) {
return java.util.Base64.getDecoder().decode(str);
}
}