mirror of
https://github.com/tursom/TursomServer.git
synced 2025-01-31 23:00:34 +08:00
add toHexString
This commit is contained in:
parent
14e5b243ac
commit
0a720af03d
@ -726,7 +726,7 @@ inline fun toDouble(get: () -> Byte): Double {
|
||||
private val UPPER_HEX_ARRAY = "0123456789ABCDEF".toCharArray()
|
||||
private val LOWER_HEX_ARRAY = "0123456789abcdef".toCharArray()
|
||||
|
||||
private inline fun <T> T.toHexString(upper: Boolean, length: Int, toBytes: ((Byte) -> Unit) -> Unit): String {
|
||||
private inline fun toHexString(upper: Boolean, length: Int, toBytes: ((Byte) -> Unit) -> Unit): String {
|
||||
val hexArray = if (upper) UPPER_HEX_ARRAY else LOWER_HEX_ARRAY
|
||||
val hexChars = CharArray(length)
|
||||
var i = 0
|
||||
|
Loading…
Reference in New Issue
Block a user