mirror of
https://github.com/rhunk/SnapEnhance.git
synced 2025-06-12 05:07:46 +02:00
fix(proto_reader): proto pretty print uuid string
This commit is contained in:
@ -225,11 +225,11 @@ class ProtoReader(private val buffer: ByteArray) {
|
||||
// auto detect uuids
|
||||
if (array.size == 16) {
|
||||
val longs = LongArray(2)
|
||||
for (i in 0..7) {
|
||||
longs[0] = longs[0] or ((array[i].toLong() and 0xFF) shl (i * 8))
|
||||
for (i in 0 .. 7) {
|
||||
longs[0] = longs[0] or ((array[i].toLong() and 0xFF) shl ((7 - i) * 8))
|
||||
}
|
||||
for (i in 8..15) {
|
||||
longs[1] = longs[1] or ((array[i].toLong() and 0xFF) shl ((i - 8) * 8))
|
||||
for (i in 8 .. 15) {
|
||||
longs[1] = longs[1] or ((array[i].toLong() and 0xFF) shl ((15 - i) * 8))
|
||||
}
|
||||
stringBuilder.append("uuid: ${UUID(longs[0], longs[1])}\n")
|
||||
return@runCatching
|
||||
|
Reference in New Issue
Block a user