src/main/java/com/webank/wecross/account/service/authcode/ImageCodeCreator.java
/**
     * Gets a numeric and alphanumeric string for the specified number of digits
     *
     * @param length
     */
Gets a numeric and alphanumeric string for the specified number of digits
@param length
Gets a numeric and alphanumeric string for the specified number of digits @param length
public static String randomString(int length) {
        if (length > CHARS.length) {
            return null;
        }
        Random random = new Random();
        StringBuffer sb = new StringBuffer();
        for (int i = 0; i < length; i++) {
            sb.append(CHARS[random.nextInt(CHARS.length)]);
        }
        return sb.toString();
    }
public static String randomString ( int length ) { if ( length > CHARS . length ) { return null ; } Random random = new Random ( ) ; StringBuffer sb = new StringBuffer ( ) ; for ( int i = 0 ; i < length ; i ++ ) { sb . append ( CHARS [ random . nextInt ( CHARS . length ) ] ) ; } return sb . toString ( ) ; }
Gets a numeric and alphanumeric string for the specified number of digits
 @param length
Gets a numeric and alphanumeric string for the specified number of digits @param length