Add thread-local secureRandom property

master
Graham 5 years ago
parent 1a19c24dcd
commit 353b8f0834
  1. 8
      common/src/main/java/dev/openrs2/common/crypto/ThreadLocalSecureRandom.kt

@ -0,0 +1,8 @@
package dev.openrs2.common.crypto
import java.security.SecureRandom
private val threadLocal = ThreadLocal.withInitial { SecureRandom() }
val secureRandom: SecureRandom
get() = threadLocal.get()
Loading…
Cancel
Save