public class RandomCodeGenerator extends Object
Generates random code sequences that can be given to users as referral codes for example.
(c) 2016 Sport Trades Ltd| Modifier and Type | Field and Description |
|---|---|
private SecureRandom |
random |
private static int |
TO_STRING_RADIX |
| Constructor and Description |
|---|
RandomCodeGenerator() |
| Modifier and Type | Method and Description |
|---|---|
String |
generateCode(int requiredCodeLength)
NOTE: The generated code is not guaranteed to be unique.
|
private static final int TO_STRING_RADIX
private final SecureRandom random
public String generateCode(int requiredCodeLength) throws IllegalArgumentException
requiredCodeLength - IllegalArgumentException - If the specified length is less than or equal to 0Copyright © 2017. All rights reserved.