replace IllegalArgumentException with require
This commit is contained in:
@@ -9,7 +9,7 @@ class Blake2b(
|
|||||||
override val bytes: Int,
|
override val bytes: Int,
|
||||||
) : HashFunction {
|
) : HashFunction {
|
||||||
init {
|
init {
|
||||||
if (bytes !in 1..64) throw IllegalArgumentException()
|
require(bytes in 1..64)
|
||||||
}
|
}
|
||||||
|
|
||||||
override val block: Int
|
override val block: Int
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ class Blake2s(
|
|||||||
override val bytes: Int,
|
override val bytes: Int,
|
||||||
) : HashFunction {
|
) : HashFunction {
|
||||||
init {
|
init {
|
||||||
if (bytes !in 1..32) throw IllegalArgumentException()
|
require(bytes in 1..32)
|
||||||
}
|
}
|
||||||
|
|
||||||
override val block: Int
|
override val block: Int
|
||||||
|
|||||||
Reference in New Issue
Block a user