public abstract class CodecUtils extends Object
Modifier and Type | Method and Description |
---|---|
static byte[] |
decodeBase64(String base64String)
other ways to do this.
|
static String |
encodeBase64(byte[] raw)
other ways to do this.
|
static String |
urlDecode(String text) |
static String |
urlEncode(String text)
other ways to do this.
|
public static String encodeBase64(byte[] raw)
new org.apache.commons.codec.binary.Base64().encode,encodeToString
io.jsonwebtoken.impl.TextCodec.BASE64.encode
com.fasterxml.jackson.core.Base64Variants.MIME_NO_LINEFEEDS.encode()
new String(org.apache.commons.codec.binary.Base64.encodeBase64(raw, UTF_8)
raw
- raw bytespublic static byte[] decodeBase64(String base64String)
org.springframework.security.crypto.codec.Base64.decode(base64String.getBytes(UTF_8.name()));
new sun.misc.BASE64Decoder().decodeBuffer(base64String);
org.apache.commons.codec.binary.Base64.decodeBase64(base64String);
base64String
- base64 stringpublic static String urlEncode(String text)
java.net.URLEncoder.encode(text, UTF_8.name())
text
- text to encodeCopyright © 2017. All rights reserved.