public class CommonUtils extends Object
| Constructor and Description |
|---|
CommonUtils() |
| Modifier and Type | Method and Description |
|---|---|
static InputStream |
file2in(String filename,
String prop) |
static String |
md5Hex(FileInputStream fis)
by input stream
|
static String |
md5Hex(String path)
get md5 hex string
|
static String |
md5HexFast(String path)
fast md5 lib, but may not faster than the jdk (7, 8)
|
static String |
randomString()
default random string
|
static String |
randomString(int length)
random generate string
|
static String |
sha256Hex(String path)
sha256 interface to call
|
static String |
showBytes(byte[] bytes) |
public static InputStream file2in(String filename, String prop) throws Exception
Exceptionpublic static String showBytes(byte[] bytes)
public static String randomString(int length)
length - public static String randomString()
public static String md5Hex(String path) throws Exception
path - Exceptionpublic static String md5HexFast(String path) throws Exception
path - Exceptionpublic static String md5Hex(FileInputStream fis) throws Exception
fis - ExceptionCopyright © 2016. All rights reserved.