create random String from BigInteger - Android java.math

Android examples for java.math:BigInteger

Description

create random String from BigInteger

Demo Code

import android.util.Log;
import java.io.UnsupportedEncodingException;
import java.math.BigInteger;
import java.net.URLEncoder;
import java.security.SecureRandom;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.Map;
import java.util.regex.Pattern;

public class Main{

    public static String randomString() {
        SecureRandom random = new SecureRandom();
        return new BigInteger(130, random).toString(32);
    }// www  .  j  ava2 s.  c  o m

}

Related Tutorials