随机数帮助类
来源:互联网 发布:excel两列数据相同合并 编辑:程序博客网 时间:2024/05/29 18:23
package util;import java.util.Random;import java.util.UUID;/** * @Title: RandomUtil.java * @Description: 随机数帮助类 */public class RandomUtil { public static String randomUUID() { return UUID.randomUUID().toString().replace("-", ""); } public static String randomValue() { UUID uuid = UUID.randomUUID(); long least = uuid.getLeastSignificantBits(); long most = uuid.getMostSignificantBits(); return ShortUrlUtils.encoding(Math.abs(least)) + ShortUrlUtils.encoding(Math.abs(most)); } public static String randomValueByLength(int length){ return randomValue().substring(2, 2+length); } public static int rand(int start,int end){ Random rand = new Random(); return rand.nextInt(end-start +1) +start ; }}
0 0
- 随机数帮助类
- 面向对象_通过JDK的帮助文档学习Math类的随机数功能
- 随机数类
- 字符串帮助类
- (转)字符串帮助类
- Excel 帮助类
- JSONHelper JSON帮助类
- ChartsUtil jfreeChart 帮助类
- .Net文件夹帮助类
- socket 通讯 帮助类
- ENUM帮助类
- PHPExcel 类库帮助
- Dictionary帮助类
- SqlHelper 帮助类
- C#时间帮助类
- 通用分页帮助类
- xml帮助类
- Xml帮助类
- 子类父类的成员变量一起初始化的方法
- poj3280 dp
- EventBus使用详解(二)——EventBus使用进阶
- GVIM在Windows上也是强大的IDE
- xperf - 收集系统事件命令
- 随机数帮助类
- 方式三:使用远程线程注入DLL
- hibernate的懒加载
- android 获取进程、服务、任务列表
- 硬皮病 中医疗法大全
- hibernate的IDE开发(第二天)
- Working with HTML Forms
- RC4算法
- 关于建立时间,保持时间,传输时间