public static String getNonce()

in java/src/main/java/com/aliyun/teautil/Common.java [287:320]


    public static String getNonce() {
        // thread id
        long threadId = Thread.currentThread().getId();
        // timestamp: ms
        long currentTime = System.currentTimeMillis();
        // sequence number
        ThreadLocalRandom random = ThreadLocalRandom.current();
        long seq = seqId.getAndIncrement();
        long rand = random.nextLong();

        StringBuffer sb = new StringBuffer();
        sb.append(processStartTime).append('-')
                .append(threadId).append('-')
                .append(currentTime).append('-')
                .append(seq).append('-')
                .append(rand);
        try {
            // hash
            MessageDigest digest = MessageDigest.getInstance("MD5");
            // hex
            byte[] msg = sb.toString().getBytes();
            sb.setLength(0);
            for (byte b : digest.digest(msg)) {
                String hex = Integer.toHexString(b & 0xFF);
                if (hex.length() < 2) {
                    sb.append(0);
                }
                sb.append(hex);
            }
        } catch(NoSuchAlgorithmException e) {
            throw new TeaUtilException(e.getMessage(), e);
        }
        return sb.toString();
    }