fix 2^n check
This commit is contained in:
@@ -11,7 +11,7 @@ open class StreamEncoding(
|
|||||||
private val padding: Byte? = null,
|
private val padding: Byte? = null,
|
||||||
) : Encoding(alphabet) {
|
) : Encoding(alphabet) {
|
||||||
init {
|
init {
|
||||||
require(base % 2 == 0)
|
require(base and (base - 1) == 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun encode(bytes: ByteArray): ByteArray {
|
override fun encode(bytes: ByteArray): ByteArray {
|
||||||
|
|||||||
Reference in New Issue
Block a user