随机字符串生成 @param bit @return
(int bit)
| 52 | * @return |
| 53 | */ |
| 54 | public static String RandomStr(int bit){ //随机字符串生成 |
| 55 | String str="abcdefhijklmnopqrstuvwxyzABCDEFHIJKLMNOPQRSTUVWXYZ"; |
| 56 | Random rand=new Random(); |
| 57 | StringBuffer buffer = new StringBuffer(); |
| 58 | for (int i = 0; i < bit; i++) { |
| 59 | int anInt = rand.nextInt(str.length()); |
| 60 | buffer.append(str.charAt(anInt)); |
| 61 | } |
| 62 | return buffer.toString(); |
| 63 | } |
| 64 | |
| 65 | /** |
| 66 | * 字节数组转16进制 |
no outgoing calls
no test coverage detected