package com.patzn.lims.common;

import java.util.Random;

/**
 * <p>
 * 随机工具类
 * </p>
 *
 * @author hubin
 * @since 2018-04-26
 */
public class RandomUtils {


    /**
     * <p>
     * 获取随机数字
     * </p>
     *
     * @param length 数字长度
     * @return
     */
    public static String getRandomNumber(int length) {
        StringBuffer out = new StringBuffer();
        Random random = new Random();
        for (int i = 0; i < length; i++) {
            out.append(random.nextInt(10));
        }
        return out.toString();
    }
}
