1.3.1 Release #5
@@ -1,9 +1,9 @@
|
||||
[versions]
|
||||
infendro = "1.1.0"
|
||||
kotlin = "2.3.0"
|
||||
bytes = "1.4.0"
|
||||
hash = "1.6.0"
|
||||
mac = "1.4.0"
|
||||
bytes = "1.4.2"
|
||||
hash = "1.7.0"
|
||||
mac = "1.5.0"
|
||||
|
||||
[plugins]
|
||||
infendro = { id = "com.infendro.plugin", version.ref = "infendro" }
|
||||
|
||||
@@ -6,6 +6,8 @@ import com.infendro.random.PRNG
|
||||
import kotlin.properties.Delegates.notNull
|
||||
|
||||
class LCG : PRNG() {
|
||||
private val function = `SHA-256`()
|
||||
|
||||
private val a: Long = 25214903917L
|
||||
private val c: Long = 11L
|
||||
private val mask: Long = (1L shl 48) - 1
|
||||
@@ -13,7 +15,7 @@ class LCG : PRNG() {
|
||||
private var x: Long by notNull()
|
||||
|
||||
override fun seed(seed: ByteArray) {
|
||||
x = `SHA-256`.hash(seed).toLong() and mask
|
||||
x = function.hash(seed).toLong() and mask
|
||||
}
|
||||
|
||||
override fun generate(): Int {
|
||||
|
||||
@@ -6,10 +6,12 @@ import com.infendro.random.PRNG
|
||||
import kotlin.properties.Delegates.notNull
|
||||
|
||||
class Xoshiro256pp : PRNG() {
|
||||
private val function = `SHA-256`()
|
||||
|
||||
private var s: LongArray by notNull()
|
||||
|
||||
override fun seed(seed: ByteArray) {
|
||||
s = `SHA-256`.hash(seed).toLongArray()
|
||||
s = function.hash(seed).toLongArray()
|
||||
}
|
||||
|
||||
override fun generate(): Int {
|
||||
|
||||
@@ -6,10 +6,12 @@ import com.infendro.random.PRNG
|
||||
import kotlin.properties.Delegates.notNull
|
||||
|
||||
class Xoshiro256ss : PRNG() {
|
||||
private val function = `SHA-256`()
|
||||
|
||||
private var s: LongArray by notNull()
|
||||
|
||||
override fun seed(seed: ByteArray) {
|
||||
s = `SHA-256`.hash(seed).toLongArray()
|
||||
s = function.hash(seed).toLongArray()
|
||||
}
|
||||
|
||||
override fun generate(): Int {
|
||||
|
||||
Reference in New Issue
Block a user