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

com.emily.infrastructure.common.UUIDUtils Maven / Gradle / Ivy

There is a newer version: 5.0.0
Show newest version
package com.emily.infrastructure.common;

import java.util.UUID;

/**
 * 自动生成token工具类
 *
 * @author Emily
 * @since 2020/04/01
 */
public class UUIDUtils {
    public static final String LINE = "-";

    /**
     * 生成简洁版UUID,即:删除横杠的UUID
     *
     * @return 唯一字符串
     */
    public static String randomSimpleUUID() {
        return randomUUID().replace(LINE, "");
    }

    /**
     * 生成唯一标识
     *
     * @return 唯一字符串
     */
    public static String randomUUID() {
        return UUID.randomUUID().toString();
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy