From 7b85c901409f76d2ae4506025b934a98851ecc9c Mon Sep 17 00:00:00 2001 From: DBotThePony Date: Sun, 9 Mar 2025 11:48:18 +0700 Subject: [PATCH] Remove raw initialization from jsf and wob2m to discourage it --- .../kotlin/ru/dbotthepony/kommons/random/JSF32Random.kt | 8 -------- .../kotlin/ru/dbotthepony/kommons/random/JSF64Random.kt | 8 -------- .../kotlin/ru/dbotthepony/kommons/random/WOB2MRandom.kt | 8 -------- 3 files changed, 24 deletions(-) diff --git a/src/main/kotlin/ru/dbotthepony/kommons/random/JSF32Random.kt b/src/main/kotlin/ru/dbotthepony/kommons/random/JSF32Random.kt index 7e9283c..78f5815 100644 --- a/src/main/kotlin/ru/dbotthepony/kommons/random/JSF32Random.kt +++ b/src/main/kotlin/ru/dbotthepony/kommons/random/JSF32Random.kt @@ -47,12 +47,4 @@ open class JSF32Random protected constructor( val b = nextInt().toLong() and 0xFFFFFFFFL return a.shl(32) or b } - - companion object { - @JvmStatic - @Deprecated("JSF suffers from 'weak seed' weakness, using raw initialization is highly discouraged, unless serializing/deserializing") - fun raw(s0: Int, s1: Int, s2: Int, s3: Int): JSF32Random { - return JSF32Random(s0, s1, s2, s3, null) - } - } } diff --git a/src/main/kotlin/ru/dbotthepony/kommons/random/JSF64Random.kt b/src/main/kotlin/ru/dbotthepony/kommons/random/JSF64Random.kt index fc55b9c..f8d7deb 100644 --- a/src/main/kotlin/ru/dbotthepony/kommons/random/JSF64Random.kt +++ b/src/main/kotlin/ru/dbotthepony/kommons/random/JSF64Random.kt @@ -46,12 +46,4 @@ open class JSF64Random( s3 = e + s0 return s3 } - - companion object { - @JvmStatic - @Deprecated("JSF suffers from 'weak seed' weakness, using raw initialization is highly discouraged, unless serializing/deserializing") - fun raw(s0: Long, s1: Long, s2: Long, s3: Long): JSF64Random { - return JSF64Random(s0, s1, s2, s3, null) - } - } } diff --git a/src/main/kotlin/ru/dbotthepony/kommons/random/WOB2MRandom.kt b/src/main/kotlin/ru/dbotthepony/kommons/random/WOB2MRandom.kt index fbfda8b..73f8d77 100644 --- a/src/main/kotlin/ru/dbotthepony/kommons/random/WOB2MRandom.kt +++ b/src/main/kotlin/ru/dbotthepony/kommons/random/WOB2MRandom.kt @@ -50,12 +50,4 @@ open class WOB2MRandom protected constructor( seed0 = temp - --count return seed1 } - - companion object { - @JvmStatic - @Deprecated("Quality of manual seeding is unknown (and probably very, very bad!), so don't use this unless serializing/deserializing") - fun raw(seed0: Long, seed1: Long, counter: Long): WOB2MRandom { - return WOB2MRandom(seed0, seed1, counter, null) - } - } }