play.libs
类 Codec

java.lang.Object
  继承者 play.libs.Codec

public class Codec
extends java.lang.Object

Codec utils


构造方法摘要
Codec()
           
 
方法摘要
static java.lang.String byteToHexString(byte[] bytes)
          Write a byte array as hexadecimal 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()
           
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

构造方法详细信息

Codec

public Codec()
方法详细信息

UUID

public static java.lang.String UUID()
返回:
an UUID String

encodeBASE64

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

参数:
value - The plain String
返回:
The base64 encoded String

encodeBASE64

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

参数:
value - The binary data
返回:
The base64 encoded String

decodeBASE64

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

参数:
value - The base64 encoded String
返回:
decoded binary data

hexMD5

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

参数:
value - The String to hash
返回:
An hexadecimal Hash

hexSHA1

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

参数:
value - The String to hash
返回:
An hexadecimal Hash

byteToHexString

public static java.lang.String byteToHexString(byte[] bytes)
Write a byte array as hexadecimal 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