బైట్ అర్రేని హెక్స్ విలువకు మార్చండి
Kotlin
xxxxxxxxxx
fun main(args: Array<String>) {
val bytes = byteArrayOf(10, 2, 15, 11)
for (b in bytes) {
val st = String.format("%02X", b)
print(st)
}
}
0A020F0B
బైట్ ఆపరేషన్లను ఉపయోగించి బైట్ అర్రేని హెక్స్ విలువకు మార్చండి
Kotlin
xxxxxxxxxx
import kotlin.experimental.and
private val hexArray = "0123456789ABCDEF".toCharArray()
fun bytesToHex(bytes: ByteArray): String {
val hexChars = CharArray(bytes.size * 2)
for (j in bytes.indices) {
val v = bytes[j].toInt() and 0xFF
hexChars[j * 2] = hexArray[v ushr 4]
hexChars[j * 2 + 1] = hexArray[v and 0x0F]
}
return String(hexChars)
}
fun main(args: Array<String>) {
val bytes = byteArrayOf(10, 2, 15, 11)
val s = bytesToHex(bytes)
println(s)
}
Linux - anc-api-tools ని ఎలా ఇన్స్టాల్ చేయాలి
Linux - curvedns ని ఎలా ఇన్స్టాల్ చేయాలి
Python - సంఖ్య సానుకూలంగా ఉందా, ప్రతికూలంగా ఉందా లేదా 0 అని తనిఖీ చేయండి
Linux - zenmap ని ఎలా ఇన్స్టాల్ చేయాలి
C - పూర్ణాంకంలో అంకెల సంఖ్యను లెక్కించండి
C++ - సంఖ్య ప్రధానమైనదా కాదా అని తనిఖీ చేయండి
C++ - లీప్ ఇయర్ని తనిఖీ చేయండి
C - డైనమిక్ మెమరీ కేటాయింపును ఉపయోగించి అతిపెద్ద సంఖ్యను కనుగొనండి
JavaScript - స్ట్రింగ్ కొన్ని అక్షరాలతో ప్రారంభమై ముగుస్తుందో లేదో తనిఖీ చేయండి
Kotlin - ఒక సంఖ్యను రివర్స్ చేయండి
Linux - zstd ని ఎలా ఇన్స్టాల్ చేయాలి
Linux - xbitmaps ని ఎలా ఇన్స్టాల్ చేయాలి
Kotlin - ఒక సంఖ్యను n దశాంశ స్థానాలకు రౌండ్ చేయండి
C++ - కోషెంట్ మరియు రిమైండర్ను కనుగొనండి
Python - Excel (XLSX) ఫైల్లను వ్రాయడం
Java - ఒక సంఖ్యను రివర్స్ చేయండి
Kotlin - సంఖ్య యొక్క కారకాన్ని కనుగొనండి
Java - పిరమిడ్ మరియు నమూనాను సృష్టించండి
We have been online since 2021 and 1 millions of people around the globe have visited our website since then
More visitors every month