Java tutorial
//package com.java2s; //License from project: Open Source License import java.security.SecureRandom; public class Main { public static String getTxRef() { String ints = "0123456789"; SecureRandom rnd = new SecureRandom(); StringBuilder sb = new StringBuilder("rave-checkout-"); for (int i = 0; i < 10; i++) { sb.append(ints.charAt(rnd.nextInt(ints.length()))); } return sb.toString(); } }