All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.diceproject.qt.util.RandomBinary Maven / Gradle / Ivy

package com.github.diceproject.qt.util;
//author: yifan

import java.util.Random;

public class RandomBinary {
	
	 public static char[] binString=new char[]{'0','1'};
	 public  static Random random;

     public static String randomBinaryString(int length){  
    	 random =new Random();
    	 
    	 String str="";
    	 while(length!=0)
    	 {
    		 str+=binString[random.nextInt(2)];
    		 length--;
    	 }
    	 
    	 return str;
     }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy