public class Codec extends Object
Part of the code comes from play!framework under apache license
| Constructor and Description |
|---|
Codec() |
| Modifier and Type | Method and Description |
|---|---|
static String |
byteToHexString(byte[] bytes)
Write a byte array as hexadecimal String.
|
static byte[] |
decodeBase64(String value)
Decode a base64 value
|
static byte[] |
decodeBASE64(String value)
Deprecated.
Use
decodeBase64(String) instead |
static String |
decodeUrl(String s) |
static String |
decodeUrl(String s,
Charset enc) |
static byte[] |
decodeUrlSafeBase64(String value)
Decode a URL safe base64 value
|
static String |
encodeBase64(byte[] value)
Encode binary data to base64
|
static String |
encodeBASE64(byte[] value)
Deprecated.
Use
encodeBase64(byte[]) instead |
static String |
encodeBase64(String value)
Encode a String to base64
|
static String |
encodeBASE64(String value)
Deprecated.
Use
encodeBase64(String) instead |
static String |
encodeUrl(String s) |
static String |
encodeUrl(String s,
Charset enc) |
static String |
encodeUrlSafeBase64(byte[] value)
Encode binary data to base64 use Url safe variant
|
static String |
encodeUrlSafeBase64(String value)
Encode a String to base64 using variant URL safe encode scheme
|
static String |
hexMD5(String value)
Build an hexadecimal MD5 hash for a String
|
static String |
hexSHA1(String value)
Build an hexadecimal SHA1 hash for a String
|
static byte[] |
hexStringToByte(String hexString)
Transform an hexadecimal String to a byte array.
|
static String |
uuid()
Alias of
UUID() |
static String |
UUID() |
public static String UUID()
@Deprecated public static String encodeBASE64(String value)
encodeBase64(String) insteadvalue - The plain Stringpublic static String encodeBase64(String value)
value - The plain Stringpublic static String encodeUrlSafeBase64(String value)
value - the plain string@Deprecated public static String encodeBASE64(byte[] value)
encodeBase64(byte[]) insteadvalue - The binary datapublic static String encodeBase64(byte[] value)
value - The binary datapublic static String encodeUrlSafeBase64(byte[] value)
value - The binary data@Deprecated public static byte[] decodeBASE64(String value)
decodeBase64(String) insteadvalue - The base64 encoded Stringpublic static byte[] decodeBase64(String value)
value - The base64 encoded Stringpublic static byte[] decodeUrlSafeBase64(String value)
value - The base64 encoded String that is encoded using encodeUrlSafeBase64(String)public static String hexMD5(String value)
value - The String to hashpublic static String hexSHA1(String value)
value - The String to hashpublic static String byteToHexString(byte[] bytes)
public static byte[] hexStringToByte(String hexString)
hexString - the stringCopyright © 2017. All Rights Reserved.