All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.iteaj.iot.client.mqtt.ClientIdGen Maven / Gradle / Ivy

There is a newer version: 3.1.1
Show newest version
package com.iteaj.iot.client.mqtt;

import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.RandomUtil;

import java.util.Date;

public class ClientIdGen {

    private static final String BASIC_CHAR = "iot0123456789eaj";

    public synchronized static String genClientId() {
        return DateUtil.format(new Date(), "yyyyMMddHHmmssSS") + "_" + RandomUtil.randomString(BASIC_CHAR, 6);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy