diff --git a/common/src/main/java/dev/openrs2/common/crypto/ThreadLocalSecureRandom.kt b/common/src/main/java/dev/openrs2/common/crypto/ThreadLocalSecureRandom.kt new file mode 100644 index 0000000000..09fce08470 --- /dev/null +++ b/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()