Java中获取32位UUID(极简、多种类型)工具类

整理一下以后开发需要用的工具类--UUID

import java.util.UUID;

/**
 * Title:uuidUtil 
 * @Param:
 * @Return:uuid
 * @author:YuMing
 * @Date:2017-12-28上午9:42:06
 */
public class uuidUtil {


	/**
	 * Title:String
	 * @Description: TODO
	 * @Param:
	 * @Return: common uuid 
	 * @throws: 
	 * @author:YuMing
	 * @Date:2017-12-28上午9:42:42
	 * @return
	 */
	public static String uuid(){
		return UUID.randomUUID().toString();
	}
	
	
	/**
	 * Title:String
	 * @Description: TODO
	 * @Param:
	 * @Return:replace - uuid
	 * @throws: 
	 * @author:YuMing
	 * @Date:2017-12-28上午9:43:51
	 * @return
	 */
	public static String uuidReplace(){
		return UUID.randomUUID().toString().replace("-", "");
	}

}

效果如下:

f8090620-60a5-4243-8696-ee171ef7e972
83ac0a5648804472ace984216794ee79


猜你喜欢

转载自blog.csdn.net/qq_24484085/article/details/78918817
今日推荐