public static void main(String... argv) {
        //random generator string
        int cnt = 1000000;
        int strLength = 22;
        int dupCnt = 0;
        long wholeTimeCost = 0;
        // create the char table
        char[] charTable = new char[64];
        int cti = 0;
        for (int i = 0; i < 10; i++) {
            charTable[cti++] = (char) ('0' + i);
        }
        charTable[cti++] = '_';
        for (int i = 0; i < 26; i++) {
            charTable[cti++] = (char) ('a' + i);
        }
        charTable[cti++] = '-';
        for (int i = 0; i < 26; i++) {
            charTable[cti++] = (char) ('A' + i);
        }
        // using index of char table in every position
        int[] usingIndex = new int[strLength];
        int lastIndex = strLength - 1;
        Map<Long, Integer> dupHash = new HashMap<>();
        for (int i = 0; i < cnt; i++) {
            StringBuilder sb = new StringBuilder("CAESE");
            //range the chars at different positions
            for (int j = lastIndex; j > 0; j--) {
                if (usingIndex[j] >= charTable.length) {
                    usingIndex[j] = 0;
                    usingIndex[j - 1]++;
                }
            }
            //append chars
            for (int j = 0; j < strLength; j++) {
                sb.append(charTable[usingIndex[j]]);
            }
            usingIndex[lastIndex]++;
            String s = sb.toString();
//            System.out.println(s);
            //record the time cost
            long ts = System.nanoTime();
            //calculate the string hash
            long hash = GeneralHashFunctionLibrary.CSDNHash(s);
//            long hash = GeneralHashFunctionLibrary.APHash(s);
            wholeTimeCost += System.nanoTime() - ts;
//            System.out.println(hash);
            Integer sameHash = dupHash.get(hash);
            if (null != sameHash) {
                sameHash++;
                dupCnt++;
            } else {
                sameHash = Integer.valueOf(1);
            }
            dupHash.put(hash, sameHash);
        }
        System.out.println("Hash collision counter: [" + dupCnt + "].");
        System.out.println("Calculate [" + cnt + "] string hashcode,cost time (ms) : [" + TimeUnit.NANOSECONDS.toMillis(wholeTimeCost) + "].");
    }