Last active
September 29, 2017 11:07
-
-
Save wookietreiber/cb9117c9fb747be3fa270242302bd073 to your computer and use it in GitHub Desktop.
java.util.Random get seed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.{ Random => JRandom } | |
import java.util.concurrent.atomic.AtomicLong | |
import scala.util.Random | |
val rng = new Random | |
val seedField = classOf[JRandom].getDeclaredField("seed") | |
seedField.setAccessible(true) | |
val seed = seedField.get(rng.self).asInstanceOf[AtomicLong].get |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.