play.libs
Class Codec

java.lang.Object
  extended by play.libs.Codec

public class Codec
extends java.lang.Object

Codec utils


Constructor Summary
Codec()
           
 
Method Summary
static java.lang.String byteToHexString(byte[] bytes)
          Write a byte array as hexedecimal String.
static byte[] decodeBASE64(java.lang.String value)
          Decode a base64 value
static java.lang.String encodeBASE64(byte[] value)
          Encode binary data to base64
static java.lang.String encodeBASE64(java.lang.String value)
          Encode a String to base64
static java.lang.String hexMD5(java.lang.String value)
          Build an hexadecimal MD5 hash for a String
static java.lang.String hexSHA1(java.lang.String value)
          Build an hexadecimal SHA1 hash for a String
static byte[] hexStringToByte(java.lang.String hexString)
          Transform an hexadecimal String to a byte array.
static java.lang.String UUID()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Codec

public Codec()
Method Detail

UUID

public static java.lang.String UUID()
Returns:
an UUID String

encodeBASE64

public static java.lang.String encodeBASE64(java.lang.String value)
Encode a String to base64

Parameters:
value - The plain String
Returns:
The base64 encoded String

encodeBASE64

public static java.lang.String encodeBASE64(byte[] value)
Encode binary data to base64

Parameters:
value - The binary data
Returns:
The base64 encoded String

decodeBASE64

public static byte[] decodeBASE64(java.lang.String value)
Decode a base64 value

Parameters:
value - The base64 encoded String
Returns:
decoded binary data

hexMD5

public static java.lang.String hexMD5(java.lang.String value)
Build an hexadecimal MD5 hash for a String

Parameters:
value - The String to hash
Returns:
An hexadecimal Hash

hexSHA1

public static java.lang.String hexSHA1(java.lang.String value)
Build an hexadecimal SHA1 hash for a String

Parameters:
value - The String to hash
Returns:
An hexadecimal Hash

byteToHexString

public static java.lang.String byteToHexString(byte[] bytes)
Write a byte array as hexedecimal String.


hexStringToByte

public static byte[] hexStringToByte(java.lang.String hexString)
Transform an hexadecimal String to a byte array.



Guillaume Bort & zenexity - Distributed under Apache 2 licence, without any warrantly