Add method to set seed

Signed-off-by: Rahul Rudragoudar <rr83019@gmail.com>
This commit is contained in:
Rahul Rudragoudar 2021-04-24 20:44:20 +05:30
parent 30bb26473e
commit 04755c0a07
No known key found for this signature in database
GPG Key ID: 0D2CE231A7287EBC
2 changed files with 5 additions and 1 deletions

View File

@ -9,6 +9,10 @@ public class HelperFunctions {
private static Random random = new Random(seed);
synchronized public static void setSeed(long seed){
random.setSeed(seed);
}
public static void setRenderingHints(Graphics2D g2d) {
g2d.setRenderingHint(
RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);

View File

@ -50,7 +50,7 @@ object Config {
val allowedMedia: Set[String] = captchaConfig.flatMap(_.allowedMedia).toSet
val allowedInputType: Set[String] = captchaConfig.flatMap(_.allowedInputType).toSet
HelperFunctions.seed = seed
HelperFunctions.setSeed(seed)
private def getDefaultConfig(): String = {
val defaultConfigMap =