/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package interfacePharmacie;

import static java.lang.Integer.min;
import static java.lang.Math.abs;
import static java.lang.Math.pow;
import static java.lang.Math.random;
import static java.lang.Math.round;
import java.util.Random;

/**
 *
 * @author IT SAMAMBEY
 */
 public class NombreAleatoire {
     
    private final String LETTERS = "abcdefghijklmnopqrstuvw";
    
    private final char [] ALPHANUMERIC =(LETTERS.toUpperCase() + "0123456789").toCharArray();
    
    public String genererNombreAleatoire(int lenght) 
    {
        StringBuilder result = new StringBuilder();
        
        for (int i = 0; i < lenght; i++) {
            
            result.append(ALPHANUMERIC[new Random().nextInt(ALPHANUMERIC.length)]);
        }
        return result.toString();
    }
}
