Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

generate random password in java

import java.util.Random;

public class PasswordGenerator {
	public static String generateRandomPassword(int len) {
		String chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghi"
          +"jklmnopqrstuvwxyz!@#$%&";
		Random rnd = new Random();
		StringBuilder sb = new StringBuilder(len);
		for (int i = 0; i < len; i++)
			sb.append(chars.charAt(rnd.nextInt(chars.length())));
		return sb.toString();
	}
}
Comment

random password generator java

public class PasswordGenerator {
	public static String generateRandomPassword(int len) {
		String chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghi"
          +"jklmnopqrstuvwxyz!@#$%&";
		Random rnd = new Random();
		StringBuilder sb = new StringBuilder(len);
		for (int i = 0; i < len; i++)
			sb.append(chars.charAt(rnd.nextInt(chars.length())));
		return sb.toString();
	}
}
Comment

PREVIOUS NEXT
Code Example
Java :: spring application properties mysql jpa 
Java :: java stream find specific element 
Java :: calculate age in days java 
Java :: default code of java 
Java :: Cannot resolve class android.support.design.widget.AppBarLayout 
Java :: how to circular a bitmap android 
Java :: flutter Uri toString and String to Uri 
Java :: java time code 
Java :: processing string to int 
Java :: android coding how to open map 
Java :: android java remove imageview source 
Java :: spigot run task later 
Java :: java cast duration to long 
Java :: import android.support.v4.media.app.NotificationCompat.MediaStyle; 
Java :: import androidx.core.util.ArraySet; ^ symbol: class ArraySet location: package androidx.core.util 
Java :: java ip regex 
Java :: jframe add label java 
Java :: java yesterday date 
Java :: cannot lock java compile cache as it has already been locked by this process 
Java :: java jpanel message error messages 
Java :: javax.xml.bind does not exist 
Java :: android studio linearlayout set margin 
Java :: StringBuilder java pop back 
Java :: Which activity lifecycle method will call in Following Scenario - Launch ActivityA - Press Device Home Button - Again Launch Application * 
Java :: java get specific element from arraylisb 
Java :: how to print the last element of an array 
Java :: regex validation for special characters in java 
Java :: lombok get error in extended classes¨ 
Java :: Spring Boot Hibernate remove underscore naming strategy 
Java :: taking string input in java 
ADD CONTENT
Topic
Content
Source link
Name
3+2 =