Move random number generator to HelperFunctions

Signed-off-by: Rahul Rudragoudar <rr83019@gmail.com>
This commit is contained in:
Rahul Rudragoudar
2021-04-24 19:36:48 +05:30
parent d62951fa51
commit 0d33f51f9e
2 changed files with 15 additions and 9 deletions

View File

@@ -6,6 +6,7 @@ import org.json4s.jackson.JsonMethods.{parse, render, pretty}
import org.json4s.JsonDSL._
import java.io.{FileNotFoundException, File, PrintWriter}
import java.{util => ju}
import lc.misc.HelperFunctions
object Config {
@@ -49,12 +50,7 @@ object Config {
val allowedMedia: Set[String] = captchaConfig.flatMap(_.allowedMedia).toSet
val allowedInputType: Set[String] = captchaConfig.flatMap(_.allowedInputType).toSet
private val random = new scala.util.Random(seed)
def getNextRandomInt(max: Int): Int =
random.synchronized {
random.nextInt(max)
}
HelperFunctions.seed = seed
private def getDefaultConfig(): String = {
val defaultConfigMap =