Class Utils
- java.lang.Object
-
- com.easemob.im.server.api.token.agora.Utils
-
public class Utils extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description static int
APP_ID_LENGTH
static long
HMAC_SHA256_LENGTH
static int
VERSION_LENGTH
-
Constructor Summary
Constructors Constructor Description Utils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static byte[]
base64Decode(java.lang.String data)
static java.lang.String
base64Encode(byte[] data)
static byte[]
compress(byte[] data)
static int
crc32(byte[] bytes)
static int
crc32(java.lang.String data)
static byte[]
decode(byte[] src)
static byte[]
decompress(byte[] data)
static byte[]
encode(byte[] src)
static int
getTimestamp()
static byte[]
hmacSign(java.lang.String keyString, byte[] msg)
static boolean
isUUID(java.lang.String uuid)
static byte[]
pack(PackableEx packableEx)
static int
randomInt()
static void
unpack(byte[] data, PackableEx packableEx)
-
-
-
Field Detail
-
HMAC_SHA256_LENGTH
public static final long HMAC_SHA256_LENGTH
- See Also:
- Constant Field Values
-
VERSION_LENGTH
public static final int VERSION_LENGTH
- See Also:
- Constant Field Values
-
APP_ID_LENGTH
public static final int APP_ID_LENGTH
- See Also:
- Constant Field Values
-
-
Method Detail
-
encode
public static byte[] encode(byte[] src)
-
decode
public static byte[] decode(byte[] src)
-
hmacSign
public static byte[] hmacSign(java.lang.String keyString, byte[] msg) throws java.security.InvalidKeyException, java.security.NoSuchAlgorithmException
- Throws:
java.security.InvalidKeyException
java.security.NoSuchAlgorithmException
-
pack
public static byte[] pack(PackableEx packableEx)
-
unpack
public static void unpack(byte[] data, PackableEx packableEx)
-
base64Encode
public static java.lang.String base64Encode(byte[] data)
-
base64Decode
public static byte[] base64Decode(java.lang.String data)
-
crc32
public static int crc32(java.lang.String data)
-
crc32
public static int crc32(byte[] bytes)
-
getTimestamp
public static int getTimestamp()
-
randomInt
public static int randomInt()
-
isUUID
public static boolean isUUID(java.lang.String uuid)
-
compress
public static byte[] compress(byte[] data)
-
decompress
public static byte[] decompress(byte[] data)
-
-