package com.ozs.kpim.util;

import java.util.Random;

/**
 * @ClassName CodeUtils
 * @Desc 生成编码
 * @Author jade
 * @Date 2019/2/20
 * @Version 1.0
 */
public class CodeUtils {

    /* *
     * @Author jade
     * @Description 随机生成编码
     * @Date 2019/2/20
     * @Param [size]
     * @return java.lang.String
    **/
    public static String getCode(int size) {
        String str = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
        String number = "";
        Random random = new Random();
        for (int i = 0; i < size; i++) {
            number += str.charAt(random.nextInt(str.length()));
        }
        return number.toUpperCase();
    }

}
