List of usage examples for org.apache.wicket.util.crypt Base64 encodeBase64
public static byte[] encodeBase64(final byte[] binaryData, final boolean isChunked, final boolean urlSafe)
From source file:sf.wicklet.ext.application.WickletSupport.java
License:Apache License
public static String randomString(final Random random, final int min, final int max) { final byte[] a = new byte[max]; random.nextBytes(a);//w w w .j a v a 2s.com int len = min; if (max != min) { len += random.nextInt(max - min + 1); } String ret = StringUtils.newStringUsAscii(Base64.encodeBase64(a, false, true)); if (ret.length() != len) { ret = ret.substring(0, len); } return ret; }