public static String getStringNumRandom(int length) {
Random random = new Random();
//生成随机数字和字母,
StringBuilder saltString = new StringBuilder(length);
for (int i = 1; i <= length; ++i) {
saltString.append(ALL_CHAR_NUM.charAt(random.nextInt(ALL_CHAR_NUM.length())));
}
return saltString.toString();
}扥时候,再使用相同的方法验证密码是否一致