commonMain.com.ionspin.kotlin.bignum.integer.util.VariousUtil.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of bignum-jvm Show documentation
Show all versions of bignum-jvm Show documentation
Kotlin Multiplatform BigNum library
/*
* Copyright (c) 2020. Ugljesa Jovanovic
*/
package com.ionspin.kotlin.bignum.integer.util
/**
* Created by Ugljesa Jovanovic
* [email protected]
* on 17-Jun-2020
*/
fun Array.hexColumsPrint(chunk: Int = 16) {
val printout = this.map { it.toString(16).padStart(2, '0') }.chunked(chunk)
printout.forEach { println(it.joinToString(separator = " ") { it.toUpperCase() }) }
}
fun UByteArray.hexColumsPrint(chunk: Int = 16) {
val printout = this.map { it.toString(16).padStart(2, '0') }.chunked(chunk)
printout.forEach { println(it.joinToString(separator = " ") { it.toUpperCase() }) }
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy